diff --git a/contracts/TokenAgentFactory.sol b/contracts/TokenAgentFactory.sol index d43c2fd..f271769 100644 --- a/contracts/TokenAgentFactory.sol +++ b/contracts/TokenAgentFactory.sol @@ -734,9 +734,7 @@ contract TokenAgent is TokenInfo, Owned, NonReentrancy { } else if (takerToOwnerTotal > ownerToTakerTotal){ uint diff = takerToOwnerTotal - ownerToTakerTotal; if (paymentsInEth) { - if (diff > totalEth) { - revert InsufficentEthersRemaining(diff, totalEth); - } + require(diff <= totalEth, InsufficentEthersRemaining(diff, totalEth)); totalEth -= diff; emit InternalTransfer(address(this), address(weth), diff, Unixtime.wrap(uint40(block.timestamp))); weth.deposit{value: diff}(); diff --git a/testIt.out b/testIt.out index 338ae07..bbe1535 100644 --- a/testIt.out +++ b/testIt.out @@ -1,9 +1,8 @@ -Compiled 1 Solidity file successfully (evm target: cancun). TokenAgentFactory Deploy TokenAgentFactory And TokenAgent - * accounts[0]->TokenAgentFactory.deploy() => 0x5FC8d326 - gasUsed: 5,417,331 0.005417331Ξ 13.54 USD @ 1.0 gwei 2500.00 ETH/USD + * accounts[0]->TokenAgentFactory.deploy() => 0x5FC8d326 - gasUsed: 5,418,089 0.005418089Ξ 13.55 USD @ 1.0 gwei 2500.00 ETH/USD * accounts[0]->tokenAgentFactory.newTokenAgent() => 0x23dB4a08 - gasUsed: 187,019 0.000187019Ξ 0.47 USD @ 1.0 gwei 2500.00 ETH/USD * accounts[1]->tokenAgentFactory.newTokenAgent() => 0x8EFa1819 - gasUsed: 189,819 0.000189819Ξ 0.47 USD @ 1.0 gwei 2500.00 ETH/USD * accounts[2]->tokenAgentFactory.newTokenAgent() => 0x6743E5c6 - gasUsed: 189,819 0.000189819Ξ 0.47 USD @ 1.0 gwei 2500.00 ETH/USD @@ -14,88 +13,88 @@ Compiled 1 Solidity file successfully (evm target: cancun). 1 0 0x8EFa1819 0x70997970 2 0 0x6743E5c6 0x3C44CdDd 3 0 0xA14d9C7a 0x90F79bf6 - * now: 5:39:18 PM, expiry: 5:41:18 PM - ✔ Test TokenAgent secondary functions (781ms) + * now: 6:26:23 PM, expiry: 6:28:23 PM + ✔ Test TokenAgent secondary functions (804ms) ✔ Test TokenAgent invalid offers # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998936756985092964 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 - 2 0x3C44CdDd 9899.998952182013658409 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998936755737337817 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 + 2 0x3C44CdDd 9899.998952180979860302 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 - * offers1: [["0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",0,1725954078,0,["0.1","0.2","0.3"],[],["1.0","1.0","0.1"]],["0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",1,1725954078,0,["0.1","0.2","0.3"],[],["1.0","1.0","0.1"]]] + * offers1: [["0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",0,1725956903,0,["0.1","0.2","0.3"],[],["1.0","1.0","0.1"]],["0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",1,1725956903,0,["0.1","0.2","0.3"],[],["1.0","1.0","0.1"]]] * accounts[1]->tokenAgents[1].addOffers(offers1) => [0, 1] - gasUsed: 471,885 0.000471885Ξ 1.18 USD @ 1.0 gwei 2500.00 ETH/USD - + tokenAgents[1].Offered(index:0, maker: 0x70997970, token: 0xe7f1725E, tokenType: 20, buySell: BUY, expiry: 5:41:18 PM, count: 0, nonce: 0, prices: [0.1,0.2,0.3], tokenIds: [], tokenss: [1,1,0.1], timestamp: 5:41:01 PM) - + tokenAgents[1].Offered(index:1, maker: 0x70997970, token: 0xe7f1725E, tokenType: 20, buySell: SELL, expiry: 5:41:18 PM, count: 0, nonce: 0, prices: [0.1,0.2,0.3], tokenIds: [], tokenss: [1,1,0.1], timestamp: 5:41:01 PM) + + tokenAgents[1].Offered(index:0, maker: 0x70997970, token: 0xe7f1725E, tokenType: 20, buySell: BUY, expiry: 6:28:23 PM, count: 0, nonce: 0, prices: [0.1,0.2,0.3], tokenIds: [], tokenss: [1,1,0.1], timestamp: 6:28:06 PM) + + tokenAgents[1].Offered(index:1, maker: 0x70997970, token: 0xe7f1725E, tokenType: 20, buySell: SELL, expiry: 6:28:23 PM, count: 0, nonce: 0, prices: [0.1,0.2,0.3], tokenIds: [], tokenss: [1,1,0.1], timestamp: 6:28:06 PM) # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998464871450447259 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 - 2 0x3C44CdDd 9899.998952182013658409 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998464870202692112 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 + 2 0x3C44CdDd 9899.998952180979860302 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 tokenAgents[1] Offers # Token Type B/S Expiry Count Nonce Prices TokenIds Tokenss Useds --- ---------- ---- ---- ------------ ----- ----- ------------------------------ ------------------------------ ------------------------------ ------------------------------ - 0 0xe7f1725E 20 BUY 5:41:18 PM 0 0 0.10, 0.20, 0.30 1.00, 1.00, 0.10 0.00, 0.00, 0.00 - 1 0xe7f1725E 20 SELL 5:41:18 PM 0 0 0.10, 0.20, 0.30 1.00, 1.00, 0.10 0.00, 0.00, 0.00 + 0 0xe7f1725E 20 BUY 6:28:23 PM 0 0 0.10, 0.20, 0.30 1.00, 1.00, 0.10 0.00, 0.00, 0.00 + 1 0xe7f1725E 20 SELL 6:28:23 PM 0 0 0.10, 0.20, 0.30 1.00, 1.00, 0.10 0.00, 0.00, 0.00 * trades1: [[1,"104761904761904761",1,[],["1050000000000000000"]]] * accounts[2]->tokenAgents[1].trade(trades1, false) - gasUsed: 143,734 0.000143734Ξ 0.36 USD @ 1.0 gwei 2500.00 ETH/USD - + tokenAgents[1].InternalTransfer(from: 0x3C44CdDd, to: 0x8EFa1819, ethers: 10.0, timestamp: 5:41:02 PM) + + tokenAgents[1].InternalTransfer(from: 0x3C44CdDd, to: 0x8EFa1819, ethers: 10.0, timestamp: 6:28:07 PM) + erc20Token.Transfer(from: 0x70997970, to: 0x3C44CdDd, tokens: 1.05) - + tokenAgents[1].Traded(index:1, taker: 0x3C44CdDd, maker: 0x70997970, token: 0xe7f1725E, tokenType: 20, makerBuySell: SELL, prices: [0.1,0.2,0], tokenIds: [], tokenss: [1,0.05,0], price: 0.104761904761904761, timestamp: 5:41:02 PM) + + tokenAgents[1].Traded(index:1, taker: 0x3C44CdDd, maker: 0x70997970, token: 0xe7f1725E, tokenType: 20, makerBuySell: SELL, prices: [0.1,0.2,0], tokenIds: [], tokenss: [1,0.05,0], price: 0.104761904761904761, timestamp: 6:28:07 PM) + weth.Transfer(src: 0x3C44CdDd, guy: 0x70997970, wad: 0.11) - + tokenAgents[1].InternalTransfer(from: 0x8EFa1819, to: 0x3C44CdDd, ethers: 10.0, timestamp: 5:41:02 PM) + + tokenAgents[1].InternalTransfer(from: 0x8EFa1819, to: 0x3C44CdDd, ethers: 10.0, timestamp: 6:28:07 PM) # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998464871450447259 100.11 998.95 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 - 2 0x3C44CdDd 9899.998808447870499345 99.89 1001.05 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998464870202692112 100.11 998.95 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 + 2 0x3C44CdDd 9899.998808446836701238 99.89 1001.05 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 tokenAgents[1] Offers # Token Type B/S Expiry Count Nonce Prices TokenIds Tokenss Useds --- ---------- ---- ---- ------------ ----- ----- ------------------------------ ------------------------------ ------------------------------ ------------------------------ - 0 0xe7f1725E 20 BUY 5:41:18 PM 0 0 0.10, 0.20, 0.30 1.00, 1.00, 0.10 0.00, 0.00, 0.00 - 1 0xe7f1725E 20 SELL 5:41:18 PM 0 0 0.10, 0.20, 0.30 1.00, 1.00, 0.10 1.00, 0.05, 0.00 + 0 0xe7f1725E 20 BUY 6:28:23 PM 0 0 0.10, 0.20, 0.30 1.00, 1.00, 0.10 0.00, 0.00, 0.00 + 1 0xe7f1725E 20 SELL 6:28:23 PM 0 0 0.10, 0.20, 0.30 1.00, 1.00, 0.10 1.00, 0.05, 0.00 ✔ Test TokenAgent ERC-20 offers and trades (57ms) # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998936756985092964 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 - 2 0x3C44CdDd 9899.998952182013658409 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998936755737337817 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 + 2 0x3C44CdDd 9899.998952180979860302 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 - * offers1: ["0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0,0,1725954078,4,100000000000000000,,","0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0,1,1725954078,4,100000000000000000,4,5,6,7,","0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0,1,1725954078,4,100000000000000000,200000000000000000,300000000000000000,400000000000000000,4,5,6,7,"] + * offers1: ["0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0,0,1725956903,4,100000000000000000,,","0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0,1,1725956903,4,100000000000000000,4,5,6,7,","0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0,1,1725956903,4,100000000000000000,200000000000000000,300000000000000000,400000000000000000,4,5,6,7,"] * accounts[1]->tokenAgents[1].addOffers(offers1) => [0, 1, 2] - gasUsed: 449,316 0.000449316Ξ 1.12 USD @ 1.0 gwei 2500.00 ETH/USD - + tokenAgents[1].Offered(index:0, maker: 0x70997970, token: 0x9fE46736, tokenType: 721, buySell: BUY, expiry: 5:41:18 PM, count: 4, nonce: 0, prices: [0.1], tokenIds: [], tokenss: [], timestamp: 5:41:01 PM) - + tokenAgents[1].Offered(index:1, maker: 0x70997970, token: 0x9fE46736, tokenType: 721, buySell: SELL, expiry: 5:41:18 PM, count: 4, nonce: 0, prices: [0.1], tokenIds: [4,5,6,7], tokenss: [], timestamp: 5:41:01 PM) - + tokenAgents[1].Offered(index:2, maker: 0x70997970, token: 0x9fE46736, tokenType: 721, buySell: SELL, expiry: 5:41:18 PM, count: 4, nonce: 0, prices: [0.1,0.2,0.3,0.4], tokenIds: [4,5,6,7], tokenss: [], timestamp: 5:41:01 PM) + + tokenAgents[1].Offered(index:0, maker: 0x70997970, token: 0x9fE46736, tokenType: 721, buySell: BUY, expiry: 6:28:23 PM, count: 4, nonce: 0, prices: [0.1], tokenIds: [], tokenss: [], timestamp: 6:28:06 PM) + + tokenAgents[1].Offered(index:1, maker: 0x70997970, token: 0x9fE46736, tokenType: 721, buySell: SELL, expiry: 6:28:23 PM, count: 4, nonce: 0, prices: [0.1], tokenIds: [4,5,6,7], tokenss: [], timestamp: 6:28:06 PM) + + tokenAgents[1].Offered(index:2, maker: 0x70997970, token: 0x9fE46736, tokenType: 721, buySell: SELL, expiry: 6:28:23 PM, count: 4, nonce: 0, prices: [0.1,0.2,0.3,0.4], tokenIds: [4,5,6,7], tokenss: [], timestamp: 6:28:06 PM) # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998487440476017936 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 - 2 0x3C44CdDd 9899.998952182013658409 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998487439228262789 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 + 2 0x3C44CdDd 9899.998952180979860302 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 tokenAgents[1] Offers # Token Type B/S Expiry Count Nonce Prices TokenIds Tokenss Useds --- ---------- ---- ---- ------------ ----- ----- ------------------------------ ------------------------------ ------------------------------ ------------------------------ - 0 0x9fE46736 721 BUY 5:41:18 PM 4 0 0.10 - 1 0x9fE46736 721 SELL 5:41:18 PM 4 0 0.10 4, 5, 6, 7 - 2 0x9fE46736 721 SELL 5:41:18 PM 4 0 0.10, 0.20, 0.30, 0.40 4, 5, 6, 7 + 0 0x9fE46736 721 BUY 6:28:23 PM 4 0 0.10 + 1 0x9fE46736 721 SELL 6:28:23 PM 4 0 0.10 4, 5, 6, 7 + 2 0x9fE46736 721 SELL 6:28:23 PM 4 0 0.10, 0.20, 0.30, 0.40 4, 5, 6, 7 * trades1: [[1,"400000000000000000",1,[4,5,6,7],[]]] * accounts[2]->tokenAgents[1].trade(trades1, false) - gasUsed: 166,608 0.000166608Ξ 0.42 USD @ 1.0 gwei 2500.00 ETH/USD - + tokenAgents[1].InternalTransfer(from: 0x3C44CdDd, to: 0x8EFa1819, ethers: 10.0, timestamp: 5:41:02 PM) + + tokenAgents[1].InternalTransfer(from: 0x3C44CdDd, to: 0x8EFa1819, ethers: 10.0, timestamp: 6:28:07 PM) + erc721Token.Approval(from: 0x70997970, to: 0x00000000, tokenId: 4) + erc721Token.Transfer(from: 0x70997970, to: 0x3C44CdDd, tokenId: 4) + erc721Token.Approval(from: 0x70997970, to: 0x00000000, tokenId: 5) @@ -104,80 +103,80 @@ Compiled 1 Solidity file successfully (evm target: cancun). + erc721Token.Transfer(from: 0x70997970, to: 0x3C44CdDd, tokenId: 6) + erc721Token.Approval(from: 0x70997970, to: 0x00000000, tokenId: 7) + erc721Token.Transfer(from: 0x70997970, to: 0x3C44CdDd, tokenId: 7) - + tokenAgents[1].Traded(index:1, taker: 0x3C44CdDd, maker: 0x70997970, token: 0x9fE46736, tokenType: 721, makerBuySell: SELL, prices: [0.1,0.1,0.1,0.1], tokenIds: [4,5,6,7], tokenss: [], price: 0.4, timestamp: 5:41:02 PM) + + tokenAgents[1].Traded(index:1, taker: 0x3C44CdDd, maker: 0x70997970, token: 0x9fE46736, tokenType: 721, makerBuySell: SELL, prices: [0.1,0.1,0.1,0.1], tokenIds: [4,5,6,7], tokenss: [], price: 0.4, timestamp: 6:28:07 PM) + weth.Transfer(src: 0x3C44CdDd, guy: 0x70997970, wad: 0.4) - + tokenAgents[1].InternalTransfer(from: 0x8EFa1819, to: 0x3C44CdDd, ethers: 10.0, timestamp: 5:41:02 PM) + + tokenAgents[1].InternalTransfer(from: 0x8EFa1819, to: 0x3C44CdDd, ethers: 10.0, timestamp: 6:28:07 PM) # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998487440476017936 100.4 1000.0 0:20, 1:20, 2:20, 3:20 - 2 0x3C44CdDd 9899.998785573847716841 99.6 1000.0 4, 5, 6, 7, 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998487439228262789 100.4 1000.0 0:20, 1:20, 2:20, 3:20 + 2 0x3C44CdDd 9899.998785572813918734 99.6 1000.0 4, 5, 6, 7, 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 tokenAgents[1] Offers # Token Type B/S Expiry Count Nonce Prices TokenIds Tokenss Useds --- ---------- ---- ---- ------------ ----- ----- ------------------------------ ------------------------------ ------------------------------ ------------------------------ - 0 0x9fE46736 721 BUY 5:41:18 PM 4 0 0.10 - 1 0x9fE46736 721 SELL 5:41:18 PM 0 0 0.10 4, 5, 6, 7 - 2 0x9fE46736 721 SELL 5:41:18 PM 4 0 0.10, 0.20, 0.30, 0.40 4, 5, 6, 7 + 0 0x9fE46736 721 BUY 6:28:23 PM 4 0 0.10 + 1 0x9fE46736 721 SELL 6:28:23 PM 0 0 0.10 4, 5, 6, 7 + 2 0x9fE46736 721 SELL 6:28:23 PM 4 0 0.10, 0.20, 0.30, 0.40 4, 5, 6, 7 - ✔ Test TokenAgent ERC-721 offers and trades (55ms) + ✔ Test TokenAgent ERC-721 offers and trades (56ms) # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998936756985092964 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 - 2 0x3C44CdDd 9899.998952182013658409 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998936755737337817 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 + 2 0x3C44CdDd 9899.998952180979860302 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 - * offers1: ["0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9,0,1725954078,40,100000000000000000,,","0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9,1,1725954078,26,100000000000000000,0,1,2,3,5,6,7,8","0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9,1,1725954078,40,100000000000000000,200000000000000000,300000000000000000,400000000000000000,0,1,2,3,10,10,10,10"] + * offers1: ["0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9,0,1725956903,40,100000000000000000,,","0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9,1,1725956903,26,100000000000000000,0,1,2,3,5,6,7,8","0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9,1,1725956903,40,100000000000000000,200000000000000000,300000000000000000,400000000000000000,0,1,2,3,10,10,10,10"] * accounts[1]->tokenAgents[1].addOffers(offers1) => [0, 1, 2] - gasUsed: 643,076 0.000643076Ξ 1.61 USD @ 1.0 gwei 2500.00 ETH/USD - + tokenAgents[1].Offered(index:0, maker: 0x70997970, token: 0xCf7Ed3Ac, tokenType: 1155, buySell: BUY, expiry: 5:41:18 PM, count: 40, nonce: 0, prices: [0.1], tokenIds: [], tokenss: [], timestamp: 5:41:01 PM) - + tokenAgents[1].Offered(index:1, maker: 0x70997970, token: 0xCf7Ed3Ac, tokenType: 1155, buySell: SELL, expiry: 5:41:18 PM, count: 26, nonce: 0, prices: [0.1], tokenIds: [0,1,2,3], tokenss: [5,6,7,8], timestamp: 5:41:01 PM) - + tokenAgents[1].Offered(index:2, maker: 0x70997970, token: 0xCf7Ed3Ac, tokenType: 1155, buySell: SELL, expiry: 5:41:18 PM, count: 40, nonce: 0, prices: [0.1,0.2,0.3,0.4], tokenIds: [0,1,2,3], tokenss: [10,10,10,10], timestamp: 5:41:01 PM) + + tokenAgents[1].Offered(index:0, maker: 0x70997970, token: 0xCf7Ed3Ac, tokenType: 1155, buySell: BUY, expiry: 6:28:23 PM, count: 40, nonce: 0, prices: [0.1], tokenIds: [], tokenss: [], timestamp: 6:28:06 PM) + + tokenAgents[1].Offered(index:1, maker: 0x70997970, token: 0xCf7Ed3Ac, tokenType: 1155, buySell: SELL, expiry: 6:28:23 PM, count: 26, nonce: 0, prices: [0.1], tokenIds: [0,1,2,3], tokenss: [5,6,7,8], timestamp: 6:28:06 PM) + + tokenAgents[1].Offered(index:2, maker: 0x70997970, token: 0xCf7Ed3Ac, tokenType: 1155, buySell: SELL, expiry: 6:28:23 PM, count: 40, nonce: 0, prices: [0.1,0.2,0.3,0.4], tokenIds: [0,1,2,3], tokenss: [10,10,10,10], timestamp: 6:28:06 PM) # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998293680256487856 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 - 2 0x3C44CdDd 9899.998952182013658409 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998293679008732709 100.0 1000.0 4, 5, 6, 7 0:20, 1:20, 2:20, 3:20 + 2 0x3C44CdDd 9899.998952180979860302 100.0 1000.0 8, 9, 10, 11 0:30, 1:30, 2:30, 3:30 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 tokenAgents[1] Offers # Token Type B/S Expiry Count Nonce Prices TokenIds Tokenss Useds --- ---------- ---- ---- ------------ ----- ----- ------------------------------ ------------------------------ ------------------------------ ------------------------------ - 0 0xCf7Ed3Ac 1155 BUY 5:41:18 PM 40 0 0.10 - 1 0xCf7Ed3Ac 1155 SELL 5:41:18 PM 26 0 0.10 0, 1, 2, 3 5, 6, 7, 8 0, 0, 0, 0 - 2 0xCf7Ed3Ac 1155 SELL 5:41:18 PM 40 0 0.10, 0.20, 0.30, 0.40 0, 1, 2, 3 10, 10, 10, 10 0, 0, 0, 0 + 0 0xCf7Ed3Ac 1155 BUY 6:28:23 PM 40 0 0.10 + 1 0xCf7Ed3Ac 1155 SELL 6:28:23 PM 26 0 0.10 0, 1, 2, 3 5, 6, 7, 8 0, 0, 0, 0 + 2 0xCf7Ed3Ac 1155 SELL 6:28:23 PM 40 0 0.10, 0.20, 0.30, 0.40 0, 1, 2, 3 10, 10, 10, 10 0, 0, 0, 0 * trades1: [[1,"2600000000000000000",1,[0,1,2,3],[5,6,7,8]]] * accounts[2]->tokenAgents[1].trade(trades1, false) - gasUsed: 172,531 0.000172531Ξ 0.43 USD @ 1.0 gwei 2500.00 ETH/USD - + tokenAgents[1].InternalTransfer(from: 0x3C44CdDd, to: 0x8EFa1819, ethers: 10.0, timestamp: 5:41:02 PM) + + tokenAgents[1].InternalTransfer(from: 0x3C44CdDd, to: 0x8EFa1819, ethers: 10.0, timestamp: 6:28:07 PM) + erc1155Token.TransferSingle(operator: 0x8EFa1819, from: 0x70997970, to: 0x3C44CdDd, tokenId: 0, tokens: 5) + erc1155Token.TransferSingle(operator: 0x8EFa1819, from: 0x70997970, to: 0x3C44CdDd, tokenId: 1, tokens: 6) + erc1155Token.TransferSingle(operator: 0x8EFa1819, from: 0x70997970, to: 0x3C44CdDd, tokenId: 2, tokens: 7) + erc1155Token.TransferSingle(operator: 0x8EFa1819, from: 0x70997970, to: 0x3C44CdDd, tokenId: 3, tokens: 8) - + tokenAgents[1].Traded(index:1, taker: 0x3C44CdDd, maker: 0x70997970, token: 0xCf7Ed3Ac, tokenType: 1155, makerBuySell: SELL, prices: [0.1,0.1,0.1,0.1], tokenIds: [0,1,2,3], tokenss: [5,6,7,8], price: 2.6, timestamp: 5:41:02 PM) + + tokenAgents[1].Traded(index:1, taker: 0x3C44CdDd, maker: 0x70997970, token: 0xCf7Ed3Ac, tokenType: 1155, makerBuySell: SELL, prices: [0.1,0.1,0.1,0.1], tokenIds: [0,1,2,3], tokenss: [5,6,7,8], price: 2.6, timestamp: 6:28:07 PM) + weth.Transfer(src: 0x3C44CdDd, guy: 0x70997970, wad: 2.6) - + tokenAgents[1].InternalTransfer(from: 0x8EFa1819, to: 0x3C44CdDd, ethers: 10.0, timestamp: 5:41:02 PM) + + tokenAgents[1].InternalTransfer(from: 0x8EFa1819, to: 0x3C44CdDd, ethers: 10.0, timestamp: 6:28:07 PM) # Account ETH WETH 0x5FbDB231 ERC-20 0xe7f1725E ERC-721 0x9fE46736 ERC-1155 0xCf7Ed3Ac --- ---------- ------------------------ ------------------------ ------------------------ ---------------------------------- ---------------------------------- - 0 0xf39Fd6e5 9899.973654483110348645 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 - 1 0x70997970 9899.998293680256487856 102.6 1000.0 4, 5, 6, 7 0:15, 1:14, 2:13, 3:12 - 2 0x3C44CdDd 9899.998779650841472471 97.4 1000.0 8, 9, 10, 11 0:35, 1:36, 2:37, 3:38 - 3 0x90F79bf6 9899.998963922511854585 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 + 0 0xf39Fd6e5 9899.973652150711487533 100.0 1000.0 0, 1, 2, 3 0:10, 1:10, 2:10, 3:10 + 1 0x70997970 9899.998293679008732709 102.6 1000.0 4, 5, 6, 7 0:15, 1:14, 2:13, 3:12 + 2 0x3C44CdDd 9899.998779649807674364 97.4 1000.0 8, 9, 10, 11 0:35, 1:36, 2:37, 3:38 + 3 0x90F79bf6 9899.998963921640809587 100.0 1000.0 12, 13, 14, 15 0:40, 1:40, 2:40, 3:40 tokenAgents[1] Offers # Token Type B/S Expiry Count Nonce Prices TokenIds Tokenss Useds --- ---------- ---- ---- ------------ ----- ----- ------------------------------ ------------------------------ ------------------------------ ------------------------------ - 0 0xCf7Ed3Ac 1155 BUY 5:41:18 PM 40 0 0.10 - 1 0xCf7Ed3Ac 1155 SELL 5:41:18 PM 0 0 0.10 0, 1, 2, 3 5, 6, 7, 8 0, 0, 0, 0 - 2 0xCf7Ed3Ac 1155 SELL 5:41:18 PM 40 0 0.10, 0.20, 0.30, 0.40 0, 1, 2, 3 10, 10, 10, 10 0, 0, 0, 0 + 0 0xCf7Ed3Ac 1155 BUY 6:28:23 PM 40 0 0.10 + 1 0xCf7Ed3Ac 1155 SELL 6:28:23 PM 0 0 0.10 0, 1, 2, 3 5, 6, 7, 8 0, 0, 0, 0 + 2 0xCf7Ed3Ac 1155 SELL 6:28:23 PM 40 0 0.10, 0.20, 0.30, 0.40 0, 1, 2, 3 10, 10, 10, 10 0, 0, 0, 0 - ✔ Test TokenAgent ERC-1155 offers and trades (56ms) + ✔ Test TokenAgent ERC-1155 offers and trades (55ms) - 5 passing (964ms) + 5 passing (988ms)