Skip to content
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): nft swap protocol v2 POC #2084

Merged
merged 84 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
3386666
functionality to deploy and mint NFTs, add nft_swap_contract_abi json…
laruh Mar 5, 2024
47b626a
Merge remote-tracking branch 'origin/dev' into nft-swaps-poc
laruh Mar 5, 2024
1f6b2f7
encode nft contracts contracture arguments
laruh Mar 5, 2024
388d2e9
encode dex_fee_address for nft_swap_data
laruh Mar 5, 2024
ccd0645
use geth_account as dex_fee_address
laruh Mar 5, 2024
141c9f0
impl CoinAssocTypes for EthCoin
laruh Mar 6, 2024
56303c6
impl NftAssocTypes. move nft tests to new nft_swap_proto_v2_tests.rs
laruh Mar 10, 2024
c9ee4de
use parse_pubkey
laruh Mar 10, 2024
35b6dbc
remove await and use block_on
laruh Mar 10, 2024
816b295
use Public from keys crate as we call derive_htlc_pubkey func
laruh Mar 10, 2024
10943d3
call try_to_address in parse_token_contract_address, recompile ERC115…
laruh Mar 11, 2024
42d27b0
Merge remote-tracking branch 'origin/dev' into nft-swaps-poc
laruh Mar 11, 2024
f937bb7
add some values and checks in send_nft_maker_payment_v2_impl func
laruh Mar 11, 2024
8484e0e
rename coin in nft_dev_conf
laruh Mar 11, 2024
53ad64c
WIP send_nft_maker_payment_v2_impl: added some validations, prepared …
laruh Mar 12, 2024
66fcead
polish send_nft_maker_payment_v2_impl func
laruh Mar 13, 2024
38f7020
Merge remote-tracking branch 'origin/dev' into nft-swaps-poc
laruh Mar 13, 2024
c42799e
call send_nft_maker_payment_v2 in nft test
laruh Mar 13, 2024
5343192
use &nft_swap_contract().to_bytes()
laruh Mar 13, 2024
3bde774
send_and_spend_erc1155_maker_payment and logs
laruh Mar 13, 2024
854482e
fill global nft wallet with ETH and search the right version of safeT…
laruh Mar 13, 2024
6f1ba46
increase gas usage for erc721 mint, use different token ids
laruh Mar 13, 2024
2c6fb5a
add note about function method
laruh Mar 13, 2024
b7fa154
return an empty Vec in to_bytes, use non async sign_and_send_transact…
laruh Mar 14, 2024
04b5a93
impl utxo_nft_eth_pair_with_random_privkey func, mint erc721 and erc1…
laruh Mar 15, 2024
855d5a3
use `pub static ref MM_CTX` for global_nft generation
laruh Mar 15, 2024
20b4452
validate_nft_maker_payment_v2_impl, payment_status_v2 WIP
laruh Mar 17, 2024
f778492
use only global nfts in nft_swap_proto_v2_tests.rs, allow only EthCoi…
laruh Mar 18, 2024
656209a
add more checks in validate_nft_maker_payment_v2_impl, use validate_n…
laruh Mar 18, 2024
014ae69
try to call my_address directly
laruh Mar 18, 2024
9cf7f17
As we call "safeTransferFrom" directly from token_address, then 'to' …
laruh Mar 18, 2024
fb5e7b2
try to decode onERC1155Received data from receipt logs
laruh Mar 19, 2024
3858db6
add taker_pub in ValidateNftMakerPaymentArgs, decode htlc_params
laruh Mar 19, 2024
942a56b
complete HTLCParams check in Erc1155
laruh Mar 19, 2024
6db6c1c
HTLCParams check in Erc721, validate erc721 payment in tests
laruh Mar 19, 2024
4f83915
wait for confirmations
laruh Mar 19, 2024
1fa2883
add No events found in receipt error, dont mint nfts to taker
laruh Mar 19, 2024
cc477ba
refactor global_nft_with_random_privkey test func with mint and fill …
laruh Mar 19, 2024
1011caa
check nft ownership
laruh Mar 20, 2024
fc888c7
add interfaceId == type(IERC721Receiver).interfaceId in function supp…
laruh Mar 20, 2024
008c999
change topic and transfer_events for ERC1155 validation
laruh Mar 20, 2024
ee42e2c
decode and validate data from tx_from_rpc.input
laruh Mar 21, 2024
360be27
polish code
laruh Mar 21, 2024
1f5a3cf
ignore erc1155 test, increase wait_until confirmation for erc721
laruh Mar 22, 2024
fa27f7b
dont ignore erc1155 test, get correct version of overloaded "safeTra…
laruh Mar 22, 2024
718305d
leave `wait_until: now_sec() + 60` for erc721, while erc1155 ignored
laruh Mar 22, 2024
9fdc5d8
correct tokenId in ValidateNftMakerPaymentArgs
laruh Mar 22, 2024
bb080f8
log Current gas limit, in ERC721 test wait_until: now_sec() + 200
laruh Mar 22, 2024
7141244
impl decode_and_validate_htlc_params, erc721_transfer_with_data fncs
laruh Mar 22, 2024
e849c43
move tests to eth_docker_tests.rs
laruh Mar 22, 2024
510df90
remove unused chain field from nft payment structures
laruh Mar 24, 2024
02a004d
spend_nft_maker_payment_v2_impl WIP
laruh Mar 24, 2024
6f9da2c
spend_nft_maker_payment_v2_impl finish
laruh Mar 24, 2024
1481375
test spend_nft_maker_payment_v2
laruh Mar 24, 2024
adfe045
provide NFT_SWAP_CONTRACT to status_and_htlc_params_from_tx_data
laruh Mar 24, 2024
ba3c032
update erc1155 Bytes abd ABI, move amount field below tokenId in spen…
laruh Mar 25, 2024
f9387cf
add validate_decoded_data func
laruh Mar 26, 2024
c600db6
use EnumFromStringify macro
laruh Mar 28, 2024
cd25455
try_tx_s! macro instead of map_err TransactionErr::Plain(ERRL!("{}", e))
laruh Mar 29, 2024
7c9ea17
rename states to MakerPaymentStateV2 and TakerPaymentStateV2, add mis…
laruh Apr 1, 2024
ba61d49
rename param to swap_contract, rename function to parse_contract_address
laruh Apr 1, 2024
3cdd257
create mod trading_proto_v2 for nft
laruh Apr 2, 2024
6edcdb9
impl prepare_spend_nft_maker_v2_data and prepare_spend_nft_maker_v2_d…
laruh Apr 2, 2024
5978908
simplify validate_nft_maker_payment_v2_impl, add doc comms
laruh Apr 2, 2024
eaf9f74
move _v2_impl functions to the beginning
laruh Apr 3, 2024
e1dbbdf
use NftSwapInfo in swap args
laruh Apr 4, 2024
23d1c99
fix: improve fields names swap_address and contract_abi, make doc com…
laruh Apr 5, 2024
0aa3033
fix: refactor todo comment about etomic swap contract implementation …
laruh Apr 5, 2024
15c8a31
fix: provide field types &'a Coin::ContractType, &'a Coin::TokenContr…
laruh Apr 5, 2024
977cf40
fix: avoid nesting code
laruh Apr 5, 2024
2d02280
fix: remove unneeded trait constraint CoinAssocTypes
laruh Apr 5, 2024
8b5476b
fix: use args:SendNftMakerPaymentArgs instead, use generic and trait …
laruh Apr 5, 2024
5d99c34
fix: provide swap_contract_address: &'a Coin::ContractAddress
laruh Apr 5, 2024
f7c8863
fix: reuse args: &SpendNftMakerPaymentArgs in prepare_spend_nft_maker…
laruh Apr 5, 2024
5fcdab1
fix fmt
laruh Apr 5, 2024
defb7bb
fix: self.my_addr() for Token::Address
laruh Apr 5, 2024
b596d1d
fix linter in tests
laruh Apr 5, 2024
71db8d7
fix: simplify validate_payment_args func, make it standalone non public
laruh Apr 7, 2024
71f4df5
fix: make validate_from_to_and_maker_status, get_decoded_tx_data_and_…
laruh Apr 7, 2024
8e6183c
fix: provide nft_swap_v2 module in eth
laruh Apr 7, 2024
76af668
fix review notes
laruh Apr 8, 2024
95411dc
fix: provide one err type in NftAssocTypes trait, rename errors
laruh Apr 9, 2024
014552d
fix: rename assoc types traits
laruh Apr 9, 2024
e74a69a
Merge remote-tracking branch 'origin/dev' into nft-swaps-poc
borngraced Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

376 changes: 357 additions & 19 deletions mm2src/coins/eth.rs

Large diffs are not rendered by default.

Loading
Loading