feat(nft-swap): add standalone maker contract and proxy support#2100
feat(nft-swap): add standalone maker contract and proxy support#2100
Conversation
…V2 contract, some --dev args in geth conf, impl wait_for_geth_node_ready
…wap-contract-sepolia-test
…e-nft-maker-swap-contract-sepolia-test # Conflicts: # mm2src/coins/eth.rs # mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
1fbe447 to
fe498fa
Compare
This reverts commit 18fa53e.
…wap-contract-sepolia-test
9dc1ea1 to
942d139
Compare
942d139 to
998708b
Compare
shamardy
left a comment
There was a problem hiding this comment.
Great work! Only non-blocker comments.
@mariocynicys @onur-ozkan can you please check if your comments are resolved and if you have any more comments.
@laruh I guess I will have to review, approve and then merge this PR #2129 first and also this PR GLEECBTC/komodo-defi-proxy#22 before merging this. Is that correct?
| } | ||
| match block_on(GETH_WEB3.eth().block_number().timeout(Duration::from_secs(6))) { | ||
| Ok(Ok(block_number)) => { | ||
| println!("Geth node is ready, latest block number: {:?}", block_number); |
There was a problem hiding this comment.
We shouldn't use println in tests, we should use log! macro instead
| ) | ||
| .unwrap(); | ||
|
|
||
| println!("Transaction sent: {:?}", result); |
…e-nft-maker-swap-contract-sepolia-test
@shamardy as for proxy PRs. I have two:
To sum up: Proxies PRs: If #2100 will be fully approved, then it means that reviewers agreed with GLEECBTC/komodo-defi-proxy#22 logic, same for #2129 and GLEECBTC/komodo-defi-proxy#23 Proxy prs can get more non braking notes after komodefi being approved, but if reviewers decide to change the format of request to Proxy layer, then we have to update komodefi nft opened prs, or open new if previous were merged |
|
reqs examples how to enable nft, with platform coin and separately curl --url "http://127.0.0.1:7783" --data '{
"userpass": "'$USERPASS'",
"method": "enable_eth_with_tokens",
"mmrpc": "2.0",
"params": {
"ticker": "MATIC",
"mm2": 1,
"swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE",
"maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE",
"taker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE",
"fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE",
"nodes": [
{
"url": "https://polygon-rpc.com"
}
],
"erc20_tokens_requests": [],
"nft_req": {
"provider":{
"type": "Moralis",
"info": {
"url":"http://localhost:6150/nft-test",
"proxy_auth":true
}
}
}
}
}'
curl --url "http://127.0.0.1:7783" --data '{
"userpass": "'$USERPASS'",
"method": "enable_nft",
"mmrpc": "2.0",
"params": {
"ticker": "NFT_MATIC",
"activation_params": {
"provider":{
"type": "Moralis",
"info": {
"url":"http://localhost:6150/nft-test",
"proxy_auth":true
}
}
}
}
}' |
…e-nft-maker-swap-contract-sepolia-test
…e-nft-maker-swap-contract-sepolia-test # Conflicts: # mm2src/mm2_main/tests/docker_tests/docker_tests_common.rs # mm2src/mm2_main/tests/docker_tests_main.rs
…e-nft-maker-swap-contract-sepolia-test
|
@laruh please fix merge conflicts so that I can give this one final look then approve and merge. I guess NFT will still work if we don't deploy komodefi proxy latest code, right? Also, since docs and coin config PRs are open, I can merge this PR without waiting for QA, unless some testing using new proxy code or for new enable method is needed first c.c. @KomodoPlatform/qa |
|
@shamardy thanks for pinging, will fix conflicts asap. i suppose they occurred after eth gas limit PR merge this night.
NFT feature should work in both cases: if latest komo proxy code deployed or not deployed. as currently I would say its more about not merging this the second nft pr #2129 to dev, as it contains Quicknode http request changes: without the up to date proxy version quicknode
Yes, I suppose this standalone nft pr could be merged to dev now, while the second nft pr with refund methods, v2 activation and Quicknode changes should be merged after @KomodoPlatform/qa team testing and docs, coins pr approve. |
…wap-contract-sepolia-test # Conflicts: # mm2src/coins/eth.rs # mm2src/coins/eth/nft_swap_v2/mod.rs
* dev: feat(nft-swap): add standalone maker contract and proxy support (#2100) feat(ETH): add `gas_limit` coins param to override default values (#2137) feat(tendermint): implement better sequence resolving logic (#2164) ci(artifact): add target for macos on apple silicon (#2163) fix(helpers): extend http to ws address conversion (#2166) fix(makerbot): add "testcoin" to provider options (#2161) fix(hd_wallet): make extended pubkey of hd wallet generic (#2159) fix(docker-tests): implement containers runtime directories (#2162) feat(tendermint): improve the `max` handling for tendermint withdraw (#2155) revert #2158 (comment) (#2160) ci(artifacts): upload build artifacts with in-tree script (#2158) test(tendermint): migrate to local/offline containerized testnets (#2128) use easingthemes/ssh-deploy@v5.0.3 for all builds except windows (#2157) chore(bin): rename mm2 binaries to kdf (#2126)
This commit introduces the following key changes related to issue #900: - Implement standalone NFT maker swap contract (EtomicSwapMakerNftV2) - Add komodefi-proxy support for NFT feature, enabling HTTP GET requests Additional changes include: - Implement Multi Standalone Etomic Swap contracts approach - Add support for EtomicSwapTakerV2 contract - Enhance security with checks for malicious token_uri links - Make clear_all parameter optional in clear_nft_db RPC (default: false) - Implement Sepolia testnet support for testing This change adopts the new Etomic swap implementation approach as discussed in GLEECBTC/etomic-swap#7 (comment)
This commit introduces the following key changes related to issue #900: - Implement standalone NFT maker swap contract (EtomicSwapMakerNftV2) - Add komodefi-proxy support for NFT feature, enabling HTTP GET requests Additional changes include: - Implement Multi Standalone Etomic Swap contracts approach - Add support for EtomicSwapTakerV2 contract - Enhance security with checks for malicious token_uri links - Make clear_all parameter optional in clear_nft_db RPC (default: false) - Implement Sepolia testnet support for testing This change adopts the new Etomic swap implementation approach as discussed in GLEECBTC/etomic-swap#7 (comment)
* dev: (22 commits) chore(release): bump mm2 version to 2.2.0-beta (GLEECBTC#2188) ci(docker-tests): ignore tendermint IBC tests for now (GLEECBTC#2185) feat(nft-swap): complete refund methods (GLEECBTC#2129) chore(release): add changelog entries for v2.1.0-beta (GLEECBTC#2165) fix(zcoin): don't force low r signing to generate htlc pubkey for zcoin (GLEECBTC#2184) chore(rust-analyzer): add rust-analyzer into the workspace toolchain (GLEECBTC#2179) chore: migrate .cargo/config to .cargo/config.toml to avoid deprecation warning (GLEECBTC#2177) fix(swaps): ensure taker payment spend confirmations (GLEECBTC#2176) feat(nft-swap): add standalone maker contract and proxy support (GLEECBTC#2100) feat(ETH): add `gas_limit` coins param to override default values (GLEECBTC#2137) feat(tendermint): implement better sequence resolving logic (GLEECBTC#2164) ci(artifact): add target for macos on apple silicon (GLEECBTC#2163) fix(helpers): extend http to ws address conversion (GLEECBTC#2166) fix(makerbot): add "testcoin" to provider options (GLEECBTC#2161) fix(hd_wallet): make extended pubkey of hd wallet generic (GLEECBTC#2159) fix(docker-tests): implement containers runtime directories (GLEECBTC#2162) feat(tendermint): improve the `max` handling for tendermint withdraw (GLEECBTC#2155) revert GLEECBTC#2158 (comment) (GLEECBTC#2160) ci(artifacts): upload build artifacts with in-tree script (GLEECBTC#2158) test(tendermint): migrate to local/offline containerized testnets (GLEECBTC#2128) ...


related to issue #900
Etomic swap implementation approach was changed to Multi Standalone Etomic Swap contracts (see GLEECBTC/etomic-swap#7 (comment))
At the first stage we are going to support
EtomicSwapMakerNftV2andEtomicSwapTakerV2contracts in NFT Swap Komodefi feature, where Maker is NFT owner and Taker swaps ETH/ETH20.token_urilinks like thishttps://docs.moralis.io/web3-data-api/evm/reference/get-wallet-nfts?address=0xf622a6C52C94b500542E2AE6bcAD24C53Bc5b6a2&chain=polygon&format=decimal&token_addresses=[]&media_items=false

https://en.wikipedia.org/wiki/Zip_bomb
clear_allparam in clear_nft_db RPC now is optional. false is default.Req/Res examples for enable eth with tokens RPC
If we want to add support of other block chain types, we will need to make
SignOpsmore generic, right now it focuses on eth types https://github.com/KomodoPlatform/komodo-defi-proxy/blob/80d92fbe1714c5052628b80d90c5a994640e3762/src/security/sign.rs#L5we will implement this as needed.