-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 KomodoPlatform/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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't use println in tests, we should use log!
macro instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, fixed here e672485
) | ||
.unwrap(); | ||
|
||
println!("Transaction sent: {:?}", result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with println
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done e672485
…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 KomodoPlatform/komodo-defi-proxy#22 logic, same for #2129 and KomodoPlatform/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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-approve
* 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 KomodoPlatform/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 KomodoPlatform/etomic-swap#7 (comment)
* dev: (22 commits) chore(release): bump mm2 version to 2.2.0-beta (KomodoPlatform#2188) ci(docker-tests): ignore tendermint IBC tests for now (KomodoPlatform#2185) feat(nft-swap): complete refund methods (KomodoPlatform#2129) chore(release): add changelog entries for v2.1.0-beta (KomodoPlatform#2165) fix(zcoin): don't force low r signing to generate htlc pubkey for zcoin (KomodoPlatform#2184) chore(rust-analyzer): add rust-analyzer into the workspace toolchain (KomodoPlatform#2179) chore: migrate .cargo/config to .cargo/config.toml to avoid deprecation warning (KomodoPlatform#2177) fix(swaps): ensure taker payment spend confirmations (KomodoPlatform#2176) feat(nft-swap): add standalone maker contract and proxy support (KomodoPlatform#2100) feat(ETH): add `gas_limit` coins param to override default values (KomodoPlatform#2137) feat(tendermint): implement better sequence resolving logic (KomodoPlatform#2164) ci(artifact): add target for macos on apple silicon (KomodoPlatform#2163) fix(helpers): extend http to ws address conversion (KomodoPlatform#2166) fix(makerbot): add "testcoin" to provider options (KomodoPlatform#2161) fix(hd_wallet): make extended pubkey of hd wallet generic (KomodoPlatform#2159) fix(docker-tests): implement containers runtime directories (KomodoPlatform#2162) feat(tendermint): improve the `max` handling for tendermint withdraw (KomodoPlatform#2155) revert KomodoPlatform#2158 (comment) (KomodoPlatform#2160) ci(artifacts): upload build artifacts with in-tree script (KomodoPlatform#2158) test(tendermint): migrate to local/offline containerized testnets (KomodoPlatform#2128) ...
related to issue #900
Etomic swap implementation approach was changed to Multi Standalone Etomic Swap contracts (see KomodoPlatform/etomic-swap#7 (comment))
At the first stage we are going to support
EtomicSwapMakerNftV2
andEtomicSwapTakerV2
contracts in NFT Swap Komodefi feature, where Maker is NFT owner and Taker swaps ETH/ETH20.token_uri
links 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_all
param 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
SignOps
more 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.