Ethereum Smart Contracts - (Basket and DEX)

One Way Dex

DEx1WaySig

Send the address along with token, fee value and verifier address.

function DEx1WaySig( address _vault, address _feeCalculator, address _baseToken, address _etherToken, address _verifierAddr)

Parameters

Name Type Description
Address_Vault String Value to change
address _feeCalculator BigNumber Value to change
address _baseToken BigNumber Value to change
address _etherToken BigNumber Value to change
address _verifierAddr Address Value to change

killExchange

Under Emergency cases to kill the exchange.

function killExchange()

Parameters

Name Type Description

updateVault

To update the Wallet.

function updateVault(address _vault)

Parameters

Name Type Description
address _vault Address Vault Address

updateExConfig

Once verified Wallet and fee values are updated.

function updateExConfig(address _wallet,  address _verifierAddr, address _feeCalculator)

Parameters

Name Type Description
address _wallet Address Wallet Address
address _verifierAddr Address Address verification
address _feeCalculator BigNumber Fee calculator

isOrderSigned

TO sign the Order using VRS Structure.

function isOrderSigned(bytes32 _msgHash, uint8 v, bytes32 r, bytes32 s, address _signer)

Parameters

Name Type Description
bytes32 _msgHash TxHash Transaction message hash
uint8 v Boolean Signature module
bytes32 r Boolean Signature module
bytes32 s Boolean Signature module
address _signer Address Signature address

validExchangeFee

Based on Sell and Buy token identifying the buy and sell value.

function validExchangeFee(address _sellerFeeToken, address _buyerFeeToken, uint256 _sellerFeeValue, uint256 _buyrFeeValue)

Parameters

Name Type Description
address _sellerFeeToken Address Seller Free tokens
address _buyerFeeToken Address Buyer free tokens
uint256 _sellerFeeValue String Seller fee value
uint256 _buyrFeeValue String Buyer Fee value

getFeeIndex

Retreive the fee value.

function getFeeIndex(address _token)

Parameters

Name Type Description
address _token Address Token Address

getTwoWayOrderHash

Once the transaction is complete receieve the hash value which contains both side value.

function getTwoWayOrderHash(address[] _sellerTokens, address[] _buyerTokens, uint256[] _sellerValues, uint256[] _buyerValues, address[5] _orderAddresses, uint256[5] _orderValues, bytes32 _orderID)

Parameters

Name Type Description
address[] _sellerTokens Address Seller Tokens
address[] _buyerTokens String Buyer Tokens
uint256[] _sellerValues String Seller Value
uint256[] _buyerValues String Buyer Value
address[5] _orderAddresses Address Order Address
uint256[5] _orderValues String Order Value
bytes32 _orderID Boolean Order ID

getOneWayOrderHashes

Once the transaction is complete receieve the hash value which contains one side value

function getOneWayOrderHashes(address[] _sellerTokens, address[] _buyerTokens, uint256[] _sellerValues, uint256[] _buyerValues, address[5] _orderAddresses, uint256[5] _orderValues, bytes32 _orderID)

Parameters

Name Type Description
address[] _sellerTokens Address Seller Tokens
address[] _buyerTokens Address Buyer Tokens
uint256[] _sellerValues String Seller Value
uint256[] _buyerValues String Buyer Value
address[5] _orderAddresses Address Order Address
uint256[5] _orderValues String Order Value
bytes32 _orderID String Order ID

getOrderHash

Order hash can be retrieved here.

function getOrderHash(address[] _tokens, uint256[] _counts, uint256 _pValue, uint256 _fValue, address _feeToken, address _maker, address _signer, bytes32 _orderID)

Parameters

Name Type Description
address[] _tokens Address Token
uint256[] _counts Address Token count
uint256 _pValue String Signature module
uint256 _fValue String Signature module
address _feeToken String Fee token
address _maker Address Maker Address
address _signer Address Signature address
bytes32 _orderID String Order ID

trasnferTokens

Can transfer tokens from one account to another.

function trasnferTokens(address[] _sellerTokens, address[] _buyerTokens, uint256[] _sellerValues, uint256[] _buyerValues, address[5] _orderAddresses, uint256[5] _orderValues)

Parameters

Name Type Description
address[] _sellerTokens Address Seller Tokens
address[] _buyerTokens Address Buyer Tokens
uint256[] _sellerValues String Seller Value
uint256[] _buyerValues String Buyuer Value
address[5] _orderAddresses Address Address of the order
uint256[5] _orderValues String Value of the order

basicSigValidations

Validating the sign transactions.

function basicSigValidations(address[5] _orderAddresses, uint8[2] _v, bytes32 _sr, bytes32 _ss, bytes32 _br, bytes32 _bs, bytes32 _sellerHash, bytes32 _buyerHash)

Parameters

Name Type Description
address[5] _orderAddresses Address Order Address
uint8[2] _v String Signature module
bytes32 _sr String Signature module
bytes32 _ss String Signature module
bytes32 _br String Signature module
bytes32 _bs String Signature module
bytes32 _sellerHash TxHash Seller Trnsaction Hash
bytes32 _buyerHash TxHash Buyer Transaction Hash

oneWayFulfillPO

One way portfolio verifications being fulfilled or not.

function oneWayFulfillPO(address[] _sellerTokens, address[] _buyerTokens, uint256[] _sellerValues, uint256[] _buyerValues, address[5] _orderAddresses, uint256[5] _orderValues, uint8[2] _v, bytes32 _br, bytes32 _bs, bytes32 _sr, bytes32 _ss, bytes32 _orderID)

Parameters

Name Type Description
address[] _sellerTokens Address Seller Tokens
address[] _buyerTokens Address Buyer Tokens
uint256[] _sellerValues String Seller Value
uint256[] _buyerValues String Buyer Value
address[5] _orderAddresses Address Order Address
uint256[5] _orderValues String Order Values
uint8[2] _v String Signature module
bytes32 _br String Signature module
bytes32 _bs String Signature module
bytes32 _sr String Signature module
bytes32 _ss String Signature module
bytes32 _orderID String Order ID

orderExists

Verify if the order placed still exists or not.

function orderExists(bytes32 _hash, bytes32 _orderID)

Parameters

Name Type Description
bytes32 _hash TxHash Has Value
bytes32 _orderID String Order ID

validateAuthorization

Validate a particular order is being authorized by the right individual or not.

function validateAuthorization(address[] _sellerTokens, address[] _buyerTokens, uint256[] _sellerValues, uint256[] _buyerValues, address[5] _orderAddresses, uint256[5] _orderValues)

Parameters

Name Type Description
address[] _sellerTokens Address Seller Tokens
address[] _buyerTokens Address Buyer Tokens
uint256[] _sellerValues String Seller Value
uint256[] _buyerValues String Buyer Value
address[5] _orderAddresses Address Order Address
uint256[5] _orderValues String Order Value

Two Way Dex

DEx2WaySig

Send the address along with token, fee value and verifier address and receive the has back again.

function DEx2WaySig( address _vault, address _feeCalculator, address _baseToken, address _etherToken, address _verifierAddr)

Parameters

Name Type Description
address _vault Address Valut Address
address _feeCalculator String Fee calculator
address _baseToken BigNumber Base token value
address _etherToken Address Ether token address
address _verifierAddr Address Verifier Address

recoverSignerAddr

To recover the address of the sender.

function recoverSignerAddr(bytes32 _msgHash, uint8 v, bytes32 r, bytes32 s)

Parameters

Name Type Description
bytes32 _msgHash TxHash Transaction Hash
uint8 v String Signature module
bytes32 r String Signature module
bytes32 s String Signature module

twoWayFulfillPO

Fulfilling the portfolio two ways.

function twoWayFulfillPO(address[] _sellerTokens, address[] _buyerTokens, uint256[] _sellerValues, uint256[] _buyerValues, address[5] _orderAddresses, uint256[3] _orderValues, uint8[2] _v, bytes32 _br, bytes32 _bs, bytes32 _sr, bytes32 _ss, bytes32 _hash, bytes32 _orderID)

Parameters

Name Type Description
address[] _sellerTokens Address Seller tokens
address[] _buyerTokens Address Buyer Tokens
uint256[] _sellerValues String Seller value
uint256[] _buyerValues String Buyer value
address[5] _orderAddresses Address Order address
uint256[5] _orderValues String Value of orders placed
uint8[2] _v String Signature module
bytes32 _br String Signature module
bytes32 _bs String Signature module
bytes32 _sr String Signature module
bytes32 _ss String Signature module
bytes32 _hash Hash Hash value
bytes32 _orderID String Order ID

Very Basic Portfolio

VBP

VBP

Very basic portfolio sending all parameters, which include owner address, assets, volume of assets, ask value, expiry block, portfolio name.

function VBP(address _owner, address[] _assets, uint256[] _volumes, uint256 _askValue, uint256 _expiryBlock, bytes32 _portfolioName)

Parameters

Name Type Description
address _owner Address Owner address
address[] _assets Address Asset address
uint256[] _volumes String Trade volume
uint256 _askValue String Ask value for the basket
uint256 _expiryBlock String Block expiry time
bytes32 _portfolioName String Portfoli Name

updatePortfolio

Update a portfolio that was already created.

function updatePortfolio (uint256 _askValue, uint256 _expiresAfter, address[] _assets,  uint256[] _volumes, bytes32 _portfolioName)

Parameters

Name Type Description
uint256 _askValue String Ask value for the basket
uint256 _expiresAfter String Block expiry time
address[] _assets Address Asset address
uint256[] _volumes String Volume of the asset
bytes32 _portfolioName String Portfolio Name

locateAsset

TO identify where the assets have moved to.

function locateAsset(address _keyAsset)

Parameters

Name Type Description
address _keyAsset Address Key asset address

updateAssets

Update the assets that had already been set in the basket.

function updateAssets(address[] _assets, uint256[] _volumes)

Parameters

Name Type Description
address[] _assets Address Asset address
uint256[] _volumes String Total volume

depositTokens

Deposit tokens into the basket.

function depositTokens(address _token, uint _amount)

Parameters

Name Type Description
address _token Address Token Address
uint _amount String Total amount

balanceOfToken

Findn out the balance of token in the contract.

function balanceOfToken(address _depositor, address _token)

Parameters

Name Type Description
address _depositor Address Depositor address
address _token Address Token address

withdrawToken

Withdraw tokens from basket.

function withdrawToken(address _token, uint256 _amount)

Parameters

Name Type Description
address _token Address Token address
uint256 _amount String Total Amount

liquidate

Liquidate tokens from my basket.

function liquidate()

Parameters

Name Type Description

publish

Publish my basket.

function publish()

Parameters

Name Type Description

cancelPortfolio

Cancel my portfolio that had been created.

function cancelPortfolio()

Parameters

Name Type Description

buy

Buy a particular basket that is available.

function buy()

Parameters

Name Type Description

moveAssets

Move assets from one address to another.

function moveAssets(address _from, address _to)

Parameters

Name Type Description
address _from Address Senders address
address _to Address Receivers address

VBP Exchange

VBPExchange

Very basic portfolio exchange main function.

function VBPExchange(address _storage, address _calc, address _proxy, address _token)

Parameters

Name Type Description
address _storage Address Storage address
address _calc Address Fee calculator address
address _proxy Address Proxy address
address _token Address Address of the token

updateExchange

Update the vbp exchange.

function updateExchange(address _storage, address _calc, address _proxy, address _token)

Parameters

Name Type Description
address _storage Address Token storage address
address _calc String Address calculator
address _proxy String Proxy Address
address _token String Token Address

getPortfolioHash

Get a particular portfolio hash.

function getPortfolioHash(address _maker, address[] _assets, uint256[] _volumes, uint256 _askValue, uint256 _expiryBlock, bytes32 _name)

Parameters

Name Type Description
address _maker Address maker Address
address[] _assets Address Asset Address
uint256[] _volumes String Transactions Volume
uint256 _askValue String Ask Value
uint256 _expiryBlock String Block Expiry
bytes32 _name String String Name

getFee

Get fee based on arket value for a particular basket.

function getFee(uint256 _askValue, uint256 _feeIndex)

Parameters

Name Type Description
uint256 _askValue String Ask Value
uint256 _feeIndex String Fee Index

createPortfolio

Create a basket portfolio

function createPortfolio(address _maker, address[] _assets, uint256[] _volumes, uint256 _askValue, uint256 _expiryBlock, bytes32 _name)

Parameters

Name Type Description
address _maker Address Maker Address
address[] _assets Address Asset Address
uint256[] _volumes String Trade volume
uint256 _askValue String Ask Value
uint256 _expiryBlock String Block expiry
bytes32 _name String Name

Recurrent Portfolio

RecurrentPortfolio

RecurrentPortfolios

Recurrent portfolio main function which is used to repeat a particualr portfolio.

function RecurrentPortfolios(address _owner, address _wallet, address[] _assets, uint256[] _volumes, uint256 _askValue, uint256 _feeRateForEther, uint256 _expiryBlock, bytes32 _portfolioName)

Parameters

Name Type Description
address _owner Address Owner address
address _wallet Address Wallet address
address[] _assets Address Asset address
uint256[] _volumes String Volume of the basket
uint256 _askValue String Ask value for the basket
uint256 _feeRateForEther String Fee rate for ether
uint256 _expiryBlock String Block expiry time
bytes32 _portfolioName String Portfolio Name

updatePortfolio

Update a particular portfolio.

function updatePortfolio (uint256 _askValue, uint256 _expiresAfter, address[] _assets,  uint256[] _volumes, bytes32 _portfolioName)

Parameters

Name Type Description
uint256 _askValue String Ask value of the basket
uint256 _expiresAfter String Expiry time
address[] _assets Address Asset address
uint256[] _volumes String Volume of the basket
bytes32 _portfolioName String Name of the portfolio

locateAsset

Locate assets on my dashboard.

function locateAsset(address _keyAsset)

Parameters

Name Type Description
address _keyAsset Address Key asset address

updateAssets

Update assets once transaction are complete.

function updateAssets(address[] _assets, uint256[] _volumes)

Parameters

Name Type Description
address[] _assets Address Asset address
uint256[] _volumes String Volume of tokens

depositTokens

Deposit tokens into my account.

function depositTokens(address _token, uint _amount)

Parameters

Name Type Description
address _token Address Token address
uint _amount String Amount

balanceOfToken

Get token banalnce in my account.

function balanceOfToken(address _depositor, address _token)

Parameters

Name Type Description
address _depositor Address Depositer Address
address _token Address Token Address

withdrawToken

Withdraw tokens from my account.

function withdrawToken(address _token, uint256 _amount)

Parameters

Name Type Description
address _token Address Token Address
uint256 _amount String Amount

liquidate

Liquidate tokens in my account.

function liquidate()

Parameters

Name Type Description

getExchangeFee

Get my exchange fee.

function getExchangeFee()

Parameters

Name Type Description

publish

Publish my portfolio.

function publish()

Parameters

Name Type Description

cancelPortfolio

Cancel my portfolio.

function cancelPortfolio()

Parameters

Name Type Description

buy

Buy portfolio or tokens on a particular exchange.

function buy(address _exchange)

Parameters

Name Type Description
address _exchange Exchange address

moveAssets

Move asstes from one address to another.

function moveAssets(address _from, address _to)

Parameters

Name Type Description
address _from Address From address
address _to Address To Address

RecurrentPortfolio Exchange

RPExchange

Recurrent portfolio exchange main function.

function RPExchange(address _storage, address _calc, address _proxy, address _token, address _wallet)

Parameters

Name Type Description
address _storage Address Storage address
address _calc String Address fee calculator
address _proxy String Proxy Address
address _token Address Token address
address _wallet Address Wallet address

updateExchange

Update my exchange once transaction are complete.

function updateExchange(address _storage, address _calc, address _proxy, address _token, address _wallet)

Parameters

Name Type Description
address _storage Address Address storage
address _calc String Address fee calculator
address _proxy String Address proxy
address _token Address Token address
address _wallet Address Wallet address

getPortfolioHash

Get my portfoilio hash once the transaction is complete.

function getPortfolioHash(address _maker, address[] _assets, uint256[] _volumes, uint256 _askValue, uint256 _expiryBlock, bytes32 _name)

Parameters

Name Type Description
address _maker Address Maker address
address[] _assets Address Asstes location address
uint256[] _volumes String Volume of the basket
uint256 _askValue String Ask value of the basket
uint256 _expiryBlock String Block expiry time
bytes32 _name String Name

getFee

Get fee of my tokens or portfoio on the exchange.

function getFee(uint256 _askValue, uint256 _feeIndex)

Parameters

Name Type Description
uint256 _askValue String Ask value of the basket
uint256 _feeIndex String Trnsaction fee index value

createPortfolio

Create a portfolio on RP Exchange.

function createPortfolio(address _maker, address[] _assets, uint256[] _volumes, uint256 _askValue, uint256 _expiryBlock, bytes32 _name)

Parameters

Name Type Description

Order Book

Authentication

addAuthorizedAddress

Add authorized addresses to echange.

function addAuthorizedAddress(address _newAddress)

Parameters

Name Type Description
address _newAddress Address New address

removeAuthorizedAddress

Remove already aurthorized addresses.

function removeAuthorizedAddress(address _newAddress)

Parameters

Name Type Description
address _newAddress Address New address

changeApprover

Change the approver who was already responsible for approving.

function changeApprover(address _newApprover)

Parameters

Name Type Description
address _newApprover Address New approver address

changeOwner

Change the owner of the portfolio or tokens or contract.

function changeOwner(address _newOwner)

Parameters

Name Type Description
address _newOwner Address New Owner address

ecrecovery

Recovering the signature hasg of every transaction.

function ecrecovery(bytes32 _msgHash, uint8 v, bytes32 r, bytes32 s)

Parameters

Name Type Description
bytes32 _msgHas Hash Message Hash
uint8 v String Signature module
bytes32 r String Signature module
bytes32 s String Signature module

Authentication Multi-Owner

addOwnership

Providing ownership to a particular newly added owner.

function addOwnership(address _newOwner)

Parameters

Name Type Description
address _newOwner Address New owner address

removeOwnership

Removing ownership.

function removeOwnership(address _owner)

Parameters

Name Type Description
address _owner Address Owner address

changeApprover

Cchange approver.

function changeApprover(address _newApprover)

Parameters

Name Type Description
address _newApprover Address New approver address

changeOwner

Change the owner of the contract.

function changeOwner(address _newOwner)

Parameters

Name Type Description
address _newOwner Address New Owner address

OrderBook

changeTraderConfig

Trade configuration changes for orderbook can be made here.

function changeTraderConfig(bool _tradeActive, address _dataStore, bool _isLocked)

Parameters

Name Type Description
bool _tradeActive Boolean Trade active status
address _dataStore Address Data store address
bool _isLocked Boolean Locked status

updateFeeCalcConfig

function updateFeeCalcConfig(address _baseToken, address _ether, uint256 _baseTokenFee, uint256 _etherFee, uint256 _normalTokenFee)

Parameters

Name Type Description
address _baseToken Address Base token address
address _ether Address Ether address
uint256 _baseTokenFee String Base token fee
uint256 _etherFee String Ether fee
uint256 _normalTokenFee Normal token fee

calcTradeFee

function calcTradeFee(uint256 _value, address _feeToken)

Parameters

Name Type Description
uint256 _value String Value of tokens
address _feeToken Address Token fee

orderHash

function orderHash(address _sellToken, address _buyToken, uint256 _totalOrderVolume, uint256 _priceRate, uint256 _numBlocksExpires, address _orderCreator, uint256 _orderType, bytes32 _orderID, address _feeToken)

Parameters

Name Type Description
address _sellToken Address Sell token address
address _buyToken Address Buy token address
uint256 _totalOrderVolume String Total order volume
uint256 _priceRate String Price Rate
uint256 _numBlocksExpires String Block expiry time
address _orderCreator Address Order creator address
uint256 _orderType String Order type
bytes32 _orderID String Order ID
address _feeToken String Token Fee

validateAndGetOrderHash

function validateAndGetOrderHash (address[6] _tokensAndAddresses, uint256[6] _volumes, uint256 _numBlocksExpires,  uint256 _orderType, bytes32 _orderID)

Parameters

Name Type Description
address[6] _tokensAndAddresses Address Token address and count
uint256[6] _volumes String Volume of tokens
uint256 _numBlocksExpires String Block expiry time
uint256 _orderType String Type of order
bytes32 _orderID String Order ID

verifySignature

function verifySignature(address _signer, bytes32 _orderHash, uint8 v, bytes32 r, bytes32 s)

Parameters

Name Type Description
address _signer Address Address of the individual who signed the transaction
bytes32 _orderHash Tx Hash Order hash
uint8 v String Signature Module
bytes32 r String Signature Module
bytes32 s String Signature Module

basicSigValidations

function basicSigValidations(address[6] _orderAddresses, uint256 _orderType, bytes32 _orderHash, uint8 v, bytes32 r, bytes32 s)

Parameters

Name Type Description
address[6] _orderAddresses Address Orderer address
uint256 _orderType String Order type
bytes32 _orderHash TxHash Order hash
uint8 v String Signature Module
bytes32 r String Signature Module
bytes32 s String Signature Module

orderAvailability

function orderAvailability(bytes32 _orderHash, address _orderCreator, uint256 _totalOrderVolume)

Parameters

Name Type Description
bytes32 _orderHash TxHash Order Hash
address _orderCreator Address Order Creator
uint256 _totalOrderVolume String Total order volume

isOrderClosedOrFulfilled

function isOrderClosedOrFulfilled(bytes32 _orderHash, address _orderCreator, uint256 _totalOrderVolume)

Parameters

Name Type Description
bytes32 _orderHash TxHash Orer Hash
address _orderCreator Address Order Creator
uint256 _totalOrderVolume String Total order volume

oredrAlreadyExists

function oredrAlreadyExists(bytes32 _orderHash, address _orderCreator)

Parameters

Name Type Description
bytes32 _orderHash TxHash Order Hash
address _orderCreator Address Order creator

createOrder

function createOrder(address _sellToken, address _buyToken, uint256 _totalOrderVolume, uint256 _priceRate, uint256 _numBlocksExpires, address _orderCreator, uint256 _orderType, bytes32 _orderID, address _feeToken)

Parameters

Name Type Description
address _sellToken Address Sell token
address _buyToken Address Buy token
uint256 _totalOrderVolume String Total order volume
uint256 _priceRate String Price rating
uint256 _numBlocksExpires String Block expiry time
address _orderCreator Address Order creator
uint256 _orderType String Order type
bytes32 _orderID String Order ID
address _feeToken Address Token fee

cancelOrder

function cancelOrder(bytes32 _orderHash, address _orderCreator, uint256 _totalOrderVolume, address _feeToken, uint256 _orderValue)
Name Type Description
bytes32 _orderHash TxHash Order hash
address _orderCreator Address Order creator
uint256 _totalOrderVolume String Total volume of the order
address _feeToken Address Token fee
uint256 _orderValue String Value of the order

fillOrder

function fillOrder(address[6] _tokensAndAddresses, uint256[6] _volumes, uint256 _numBlocksExpires,  uint256 _orderType, uint8 v, bytes32 r, bytes32 s, bytes32 _orderID)

Parameters

Name Type Description
address[6] _tokensAndAddresses Address Value of tokens and also the address
uint256[6] _volumes String Volume of the trade
uint256 _numBlocksExpires String Block expiry time
uint256 _orderType String Order type
uint8 v String Signature module
bytes32 r String Signature module
bytes32 s String Signature module
bytes32 _orderID String Order ID

walletTransfers

function walletTransfers(address[6] _tokensAndAddresses, uint256[6] _volumes)

Parameters

Name Type Description
address[6] _tokensAndAddresses Address Tokens and address to send
uint256[6] _volumes String Volume of the trade

orderMatchHash

function orderMatchHash(address[6] _tokensAndAddresses, uint256[5] _volumes, bytes32 _orderMatchID, uint256 _expiryBlockNumber)

Parameters

Name Type Description
address[6] _tokensAndAddresses Address
uint256[5] _volumes String Total volume
bytes32 _orderMatchID String Order match ID
uint256 _expiryBlockNumber String Block expiry number

fillOrderMatch

function fillOrderMatch(address[6] _tokensAndAddresses, uint256[5] _volumes, uint256 _expiryBlockNumber, bytes32 _orderMatchID,uint8 v, bytes32 r, bytes32 s)

Parameters

Name Type Description
address[6] _tokensAndAddresses Address Tokens and address
uint256[5] _volumes String Total volume
uint256 _expiryBlockNumber String Block expiry number
bytes32 _orderMatchID String Order match ID
uint8 v String Signature module
bytes32 r String Signature module
bytes32 s String Signature module

balanceOf

function balanceOf(address _depositor)

Parameters

Name Type Description
address _depositor Address Depositor Address

balanceOfToken

function balanceOfToken(address _depositor, address _token)

Parameters

Name Type Description
address _depositor Address Depositor Address
address _token Address Token address

deposit

function deposit(address _depositor)

Parameters

Name Type Description
address _depositor Address Depositor address

depositTokens

function depositTokens(address _depositor, address _token, uint256 _amount)

Parameters

Name Type Description
address _depositor Address Depositor address
address _token Address Token address
uint256 _amount String Amount

withdrawTo

function withdrawTo(address _to, uint256 _amount)

Parameters

Name Type Description
address _to Address Receivers address
uint256 _amount String Total amount

withdrawTokenTo

function withdrawTokenTo(address _to, address _token, uint256 _amount)

Parameters

Name Type Description
address _to Address Receivers address
address _token Address Token address
uint256 _amount String Total amount

moveToSafetyWallet

function moveToSafetyWallet()

Parameters

Name Type Description

walletTransfer

function walletTransfer(address _from, address _to, address _token, uint256 _amount)

Parameters

Name Type Description
address _from Address Senders address
address _to Address Receivers address
address _token Address Token address
uint256 _amount String Total amount

OrderBook

function OrderBook(address _newApprover, address _newWallet, address _dataStore)

Parameters

Name Type Description
address _newApprover Address Approvers address
address _newWallet Address New Wallet address
address _dataStore Address Data store address

Order Vault

addOwner

Add a particular owner to a vault.

function addOwner(address newOwner)

Parameters

Name Type Description
address newOwner Address New Owner address

removeOwner

Remove ownership of a particualar address.

function removeOwner(address _owner)

Parameters

Name Type Description
address _owner Address Owner address

OrderVault

Order a new Vault.

function OrderVault()

Parameters

Name Type Description

openVault

Opening up a new vault.

function openVault(uint256 _startTime, uint256 _closureTime)

Parameters

Name Type Description
uint256 _startTime String Start time of the vault
uint256 _closureTime String Expiry time for the vault

extendVault

Extend the vault.

function extendVault(uint256 _closureTime)

Parameters

Name Type Description
uint256 _closureTime String Expiry time for the basket

closeVault

Closing the vault.

function closeVault()

Parameters

Name Type Description

storeInVault

Store the values on the valut.

function storeInVault(bytes32 _orderHash, bytes32 _orderID)

Parameters

Name Type Description
bytes32 _orderHash TxHash Transaction Hash
bytes32 _orderID String Order ID

sealVault

Set the value for a particular asset on the exchange.

function sealVault()

Parameters

Name Type Description

getNumberOfOders

Get the number of orders on the exchange that are being placed.

function getNumberOfOders()

Parameters

Name Type Description

orderLocated

Locate the order. Which address owns the new contract.

function orderLocated(bytes32 _hash, bytes32 _orderID)

Parameters

Name Type Description
bytes32 _hash String Transaction Hash
bytes32 _orderID String Order ID

Ownable

Ownable

Identify who own the contract.

function Ownable()

Parameters

Name Type Description

transferOwnership

Transfer ownership from one address to another.

function transferOwnership(address newOwner)

Parameters

Name Type Description
address newOwner Address Address of the owner