I'm exploring method trade
of this smart contract that looks like the following:
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) {
//amount is in amountGet terms
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(
(orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash), v, r, s) == user) &&
block.number <= expires &&
safeAdd(orderFills[user][hash], amount) <= amountGet
)) throw;
tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount);
orderFills[user][hash] = safeAdd(orderFills[user][hash], amount);
Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender);
}
Could you please answer the following questions:
- What's difference between
amountGet
andamount
arguments? - How can I eventually know how many
ETH
user got when selling ARC token in this transaction ? DoesamountGive
give me this value?
Decoded input of this transaction is:
inputs: [
'0xac709fcb44a43c35f0da4e3163b117a17f3770f5',
'2500000000000000000000',
'0x0000000000000000000000000000000000000000',
'13775000000000000000',
'3156959',
'3696351802',
'0xd8eeda4ee2657bb267bc35c1d60babdc5aedd269',
'28',
'b4bf0dcd37ca73bd5abce9532b033dcc6427be160683de113efca41320c27f3e',
'78799d84040e5c245828b1b531ef97e1af124946f4dc1db5a20cf28a7073b269',
'726181804936299500000'
]
Thanks for your answers in advance!