tokamak-network / crossTrade

Cross Trade is a new core service for optimistic rollups that complements standard withdrawals and fast withdrawals. It is trustless and do not require extensive backend.
4 stars 1 forks source link

add Testing for further development #24

Open zzooppii opened 3 months ago

zzooppii commented 3 months ago

I only conducted simple tests for this development(CrossTradeContract). so need the Add Test Additionally, i plan to conduct additional tests to ensure that no problems occur. Testing was conducted only based on Thanos Chain, but additional testing is scheduled to be conducted using Titan Chain.

Additional Test List

zzooppii commented 1 month ago

add task

  1. L1Cancel event update
  2. New Deploy on Sepolia
  3. Setting the L1 & L2 CrossTradeContract
  4. register the resisteredTokenList (USDT, USDC)
zzooppii commented 1 month ago

New Deploy on Sepolia L1CrossTradeProxy: 0x32C0E75aF31F73F9B4E9252861988637412e4149 L1CrossTradeLogic: 0xF4B6ab8280f1c53e2059Dc9E5b62482c86128AC9

Setting the L1 & L2 CrossTradeContract L1 setChainInfo : https://sepolia.etherscan.io/tx/0xbbbd4b7838aa739bba84f53a1d22bcbe6d6894e1da46762a5039c828157e9f60 L2 setChainInfo : https://explorer.titan-sepolia.tokamak.network/tx/0xe1614919e6c8d70746437f01c075855c83aa4ce7ad6df7760057640c01368ad6

Register the USDT, USDC Register the USDT : https://explorer.titan-sepolia.tokamak.network/tx/0xf462eb3863143043ed44d89989452d4a9668104edb3478e28757826d333b201e Register the USDC : https://explorer.titan-sepolia.tokamak.network/tx/0x18f61d0f48d01c42eaf37e977b89a30bbf24eb9d782c6b6f4a41595efe831024

zzooppii commented 1 month ago

add task

  1. L1Provide, L2Claim event update
  2. New Deploy on Sepolia And TitanSepolia
  3. Setting the L1 & L2 CrossTradeContract
  4. register the resisteredTokenList (ETH, TON , TOS, USDT, USDC)
zzooppii commented 1 month ago

New Deploy on Sepolia L1CrossTradeProxy: 0x17985dc326661c7F43Dd79d216D4027f453704F7 L1CrossTradeLogic: 0xC55E3A821f9F7C2C27A2ca9D7059d22C9DA75700

L2CrossTradeProxy: 0xBD20Cd677066ced4099A479feBD2A416686917BB L2CrossTradeLogic: 0x378ab8A2aC543EE02F9AA3d5Bac6fD66095B7b72

Setting the L1 & L2 CrossTradeContract L1 setChainInfo : https://sepolia.etherscan.io/tx/0xdc333506598e78ce772d9e6d506dd12e4896edeaeb1746c65dfaae41afc11ad9 L2 initialize : https://explorer.titan-sepolia.tokamak.network/tx/0xd03ec97f7b72a70eb22570a06d728c805052997e56c5c74b35ca0a57b977db16 L2 setChainInfo : https://explorer.titan-sepolia.tokamak.network/tx/0xbc3b462dae64cb9b9b12d99775be35c5d39d0e7d5e47075049b5759b1da48f58

Register the TON, TOS, USDT, USDC Register the TON : https://explorer.titan-sepolia.tokamak.network/tx/0x75b4fd16bdeec6c469c013c907aff9a64ec5d05b5af8a40da3265f2564b00043 Register the TOS : https://explorer.titan-sepolia.tokamak.network/tx/0xa98ca24ae243ecc74f1d649d3fee2df779b6ce0eb0695c241ba28472c5f90c15 Register the ETH : https://explorer.titan-sepolia.tokamak.network/tx/0xcf3338af3b67efe6164185871a16dd10dd7040bb5fa4bd265b5c7a5a1a0e197c Register the USDT : https://explorer.titan-sepolia.tokamak.network/tx/0x3427762ae07d249f806233b5c9860e91d40f3c8c488d67c46e8be60c96f6e687 Register the USDC : https://explorer.titan-sepolia.tokamak.network/tx/0xaf8b19d7a09548246ef58e3c21af47d92c816e87519283ef1ba8b7eb28741346

zzooppii commented 1 month ago

add test on Sepolia & TitanSepolia

1.Provide first and if a request with the same information is made 2.Provide first and if a request with the same saleCount but different information is made 3.Edit first and if a request with the same information is made 4.Edit first and if a request with the same saleCount but different information is made 5.Cancel first and if a request with the same information is made 6.Cancel first and if a request with the same saleCount but different information is made

zzooppii commented 1 month ago
  1. Provide first and if a request with the same information is made Provide in L1 Tx: https://sepolia.etherscan.io/tx/0xe0db1f50b565f7e5508063efeb068f48ca8f7632f593cbd21e82f82179e30362 Provide in L2(Fail) Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x2f16516dc057c2300e901e666ad8fc294c91b3acd49b81e304e5250151a0bd78 Request Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x3e25980fe270e09696fd71769818f50bd7c3e6a7328483d3e1bf85f6aa972f3c resendProvideCTMessage in L1 Tx: https://sepolia.etherscan.io/tx/0xf25291b7e35be3dc71fd8c0ea2b1eca6610fd0964eb5acd6f935234b655cb907 resendProvideCTMessage in L2 Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x7250eb18ceea56a47ae8ed558272eb329fa5b4fb97fdf64f1cc98b8d0cefac0c
zzooppii commented 1 month ago

2.Provide first and if a request with the same saleCount but different information is made Provide in L1 Tx: https://sepolia.etherscan.io/tx/0xd81026ffdb72ca790cee5a81a707d11a73f5aa5c66e8cd42d4becd68532f4187 Provide in L2(Fail) Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x0845ffbb36116f712ff012c5a41d34b0fcc38b8e9d65ffc0cd5ee56d96df4296 Request Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x2e80699919a30c186973896389d07410bc23e9879e3f3c1b6747748cab1e7b2d resendProvideCTMessage in L1 Tx: https://sepolia.etherscan.io/tx/0x5bafb9dda8ab32acd4e6adfec8ea5b680ce30115bc8238b6e25dc983d87842b9 resendProvideCTMessage in L2(Fail) Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x1d3b2db5246edf195424ebf78e140fb59d821d57a2c2d64b2b8e1f39bd3722c6

zzooppii commented 1 month ago

3.Edit first and if a request with the same information is made Edit in L1 Tx: https://sepolia.etherscan.io/tx/0x7c8ea0d9f8829457a55b7cda53a64cc1424413366ae309ed1d568d686ed37f22 Request Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x6010f470c5cff9426e46b35459df3adf037a29c77ccb8fd3ec5afe00885b9e25/logs Provide in L1(Edited Amount) Tx: https://sepolia.etherscan.io/tx/0x7704d55bef0622fcc039662b7a54f9102cf9d8ee4a3f8ebd973405bb5021158e Provide in L2 Tx: https://explorer.titan-sepolia.tokamak.network/tx/0xa0d474c4272fb3e4ed35c71e9931e6e160d894aa0a4d9df128b7ab3faa82b7c1

zzooppii commented 1 month ago

4.Edit first and if a request with the same saleCount but different information is made Edit in L1 Tx: https://sepolia.etherscan.io/tx/0x2a57b2de2845653cdfa8f19b8c4951b8415588903682fc434e12b883066b2a2e Request Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x133af9257430fbf34cd36096bb9947c75a9bee8f9244309ee092a90f38bbd60f Provide in L1(not Edited Amount) Tx: https://sepolia.etherscan.io/tx/0x1f2b2a4277c359417f678c868d6006a48d48e9179789c7f9ab748bb2e1012516 Provide in L2 Tx: https://explorer.titan-sepolia.tokamak.network/tx/0xedd5a209bcba9c080236a7d056f05913bf249fb979aa236a56d90a9a0b7b0af0

zzooppii commented 1 month ago
  1. Cancel first and if a request with the same information is made

Cancel in L1 Tx: https://sepolia.etherscan.io/tx/0x501fa8e7c5d623cb9402915638eadb8930b7facbf61ece8cf56eb5aa9cef908f Cancel in L2(Fail) Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x4fdeeb6923d6724bcad981738168a52895104ac4af4c184422caddccc77f6f79 Request Tx: https://explorer.titan-sepolia.tokamak.network/tx/0xc4eb47cb7cef4fd16e08c8337bfe6ce14c4798f94cde7ff3117f1b0f06db62f4

Provide in L1 Fail (already sold)

resendCancelMessage in L1 Tx: https://sepolia.etherscan.io/tx/0xa65ea3255da1e4f0feb007304b55f3493a378b63ff114696aa83c91ed177bc83 resendCancelMessage in L2 Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x59521603934e301c8d0f3e99e78143e397eafd8670e1785b8faff17cc5f1595f/logs

zzooppii commented 1 month ago

6.Cancel first and if a request with the same saleCount but different information is made

Cancel in L1 Tx: https://sepolia.etherscan.io/tx/0x8b32c3c1a583ec6a4722a1c1fdbd0c481d548289346b6db0d2d421c467f27836 Cancel in L2(Fail) Tx: https://explorer.titan-sepolia.tokamak.network/tx/0x81705815746d01eaacbc525d82acfa96421014acd51e2c4aae87e8f30afbb424 Request Tx: https://explorer.titan-sepolia.tokamak.network/tx/0xb4be9c6cb00ff6c0dde167f0e993f04acc0d3e7ea8681329dbc5147fd96ae2a7 resendCancelMessage in L1 Tx: https://sepolia.etherscan.io/tx/0x4196bfa5c2c76e0e19165d6073bfb4a67c7ca376ac1f0a300fa56a2a5e4e2421 resendCancelMessage in L2(need Fail But Success) Tx: https://explorer.titan-sepolia.tokamak.network/tx/0xe4858adfa29d173264e244b16cb0ecaf17fa68de4b1310840e25beb952867a23

@suahnkim Should have failed but succeeded After analyzing, I found that only Request and SaleCount were important points in Cancel. Is it correct that other values ​​must match for Cancel to be possible?

suahnkim commented 1 month ago

Let's have a call about the result? @zzooppii

zzooppii commented 1 month ago

add task

  1. check the ToL2Message
  2. delete the not need code
  3. check not need the save storage
  4. apply issue 55
  5. add event parameter L1, L2
zzooppii commented 1 month ago

solve the apply issue 55 https://github.com/tokamak-network/crossTrade/issues/55#issuecomment-2282777230

zzooppii commented 1 month ago

add event parameter L1, L2

L1CrossTradeContract

event EditCT( address _l1token, address _l2token, address _requester, uint256 _totalAmount, uint256 _ctAmount, uint256 indexed _saleCount, uint256 _l2chainId, bytes32 _hash );

event L1CancelCT( address _l1token, address _l2token, address _requester, uint256 _totalAmount, uint256 indexed _saleCount, uint256 _l2chainId, bytes32 _hash );

L2CrossTradeContract

event CancelCT( address _requester, uint256 _totalAmount, uint256 indexed _saleCount, uint256 _l2chainId, bytes32 _hash );

zzooppii commented 1 month ago

add task

  1. Deploy & Setting Contract
  2. apply issue 56
  3. getHash parameter change
zzooppii commented 1 month ago

Deploy & Setting on Sepolia L1CrossTradeLogic: 0xca7808601Cf65bc3E4175b574D7f98E6dCDd7c9D upgradeTo : https://sepolia.etherscan.io/tx/0xaad3de0c3a2ddf0d9da5b3a87c7eea47ce20f1b778cf15c01fcfdb16645cff25

Deploy & Setting on Titan-Sepolia L2CrossTradeLogic 0xaEE06B9D4209da37F16081fDAFF929426004D9f5 upgradeTo : https://explorer.titan-sepolia.tokamak.network/tx/0xc0dc7356be628df49d43ae489e59e24108ed0fd0ddfb73cc2206efcc034f28ed

zzooppii commented 1 month ago

solve the apply issue56 https://github.com/tokamak-network/crossTrade/commit/3b0dfa5743502e4997fe802b50f022cd94ba89c6

zzooppii commented 1 month ago

add task

  1. Deploy & Setting Contract
  2. develop the testscript about otherToken Test
  3. check the CrossTrade fault tx Case
  4. add function claimOwnerCT, cancelOwnerCT, checkModify for check Error
zzooppii commented 3 weeks ago
  1. CrossTrade fault tx Case with Suah
zzooppii commented 2 weeks ago

add task

  1. Deploy & Setting Contract
  2. develop the testscript about otherToken Test
zzooppii commented 2 weeks ago

New Deploy on Sepolia L1CrossTradeProxy: 0x57BD88F20003185CB136f859e7724DD75910FD75 L1CrossTradeLogic: 0x580d3159adE0e95558d10A0Dc9d55A9Ee84F3E27

L2CrossTradeLogic 0x663A727e7375b2f3081690F45EBB926b127CB03a

Setting the L1 CrossTradeContract L1 setChainInfo : https://sepolia.etherscan.io/tx/0x9e394ed3461e2814c28b3bfc46fbc9d662b63a0cb8472d314a3e17c5672752b8

zzooppii commented 2 weeks ago

New Deploy on Titan-Sepolia L2CrossTradeProxy: 0x2270BF371160810DfE48777987De96E641952144 L2CrossTradeLogic: 0x08821E390c3a8a4f36e8c1fdF32D1c28795141A3

Setting the L2 CrossTradeContract L2 initialize : https://explorer.titan-sepolia.tokamak.network/tx/0x79a63042d4b6922fd4fe0ce15f4023aa39c4959a967ab10b3469ef4ad45634c1 L2 setChainInfo : https://explorer.titan-sepolia.tokamak.network/tx/0x004b0c7e94f9ccab6a4088849dbc854150b736cf54feeff9ad15e57c44262103

Register the TON, TOS, USDT, USDC Register the TON : https://explorer.titan-sepolia.tokamak.network/tx/0x7d6f2b1bb60a6935ad7f6c6ca1495a205de085c8bc48afae4572003f15c322ea Register the TOS : https://explorer.titan-sepolia.tokamak.network/tx/0x50084ffeca601d36143c09ccb117e95005e8abe56e3ef957de780f77cfec22bd Register the ETH : https://explorer.titan-sepolia.tokamak.network/tx/0x3da2d003339cbf24c80b39066ad0bc0f9538af75e5588bdd55c8f2b579b24102 Register the USDT : https://explorer.titan-sepolia.tokamak.network/tx/0x5296b5113d63ea79ce394272a76b7eef9b7fa140794106022c0fedbcaeede7e4 Register the USDC : https://explorer.titan-sepolia.tokamak.network/tx/0xf08b416f4a770ec02dee0355e4fa9faebab0ef0887d3a29c95a07aad2e7da45e