Skip to content

Conversation

@laruh
Copy link

@laruh laruh commented Jan 16, 2024

This Pull Request introduces the functionality to enable EVM based coin as a platform coin along with its associated Non-Fungible Tokens (NFTs) owned by user.
Also PR includes enable_nft implementation, which works same way as enable_erc20.

Main Features:

  1. enable_eth_with_tokens PRC: now works for both erc20 and nfts activation.
  2. New enable_nft RPC: re utilizes enable_token::<EthCoin> function
  3. NFT update in Coins Context: Ensures that the global NFT within the coins context is updated with the latest NFT information.

Copy link

@borngraced borngraced left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! first iteration focusing on only some codes

@laruh
Copy link
Author

laruh commented Jan 19, 2024

linter fails in CI
👀 hmmm I dont have this linter error locally

error[E0434]: can't capture dynamic environment in a fn item
   --> mm2src/coins/eth/v2_activation.rs:322:17
    |
322 |             ..**self
    |                 ^^^^
    |
    = help: use the `|| { ... }` closure form instead

For more information about this error, try `rustc --explain E0434`.
error: could not compile `coins` due to previous error
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

May be we have different env in CI, will revert this change

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR! Only 2 comments at this stage since the first comment will lead to a lot of changes that I would rather review the code after them.

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next review iteration! Still have one more iteration to go as I found this review is growing, please resolve conflicts also, there was a change in the web3 transport interface due to this #2058 .

coin: &str,
) -> Result<(Json, T), MmError<CoinConfWithProtocolError>> {
let conf = coin_conf(ctx, coin);
let (conf, coin_protocol) = match Chain::from_nft_ticker(coin) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was a bit wrong in suggesting not adding NFTs in coin configs, if moralis supported more EVM chains or we moved away from moralis for a web3 native implementation (if possible in the future), it would be easier to add new chains and their NFTs in config without requiring a PR in komodefi. I guess one way to do this in the future is to have a field in platform coin configuration for if they support NFT or not, and we enable global NFT using the platform ticker and append NFT_ prefix to it. This is not needed at all for now, but if it was requested in the future we can do it.

@laruh laruh force-pushed the enable-eth-non-fungible-tokens branch from 507194a to 7e98ae1 Compare February 27, 2024 16:07
…e-tokens

# Conflicts:
#	mm2src/coins/eth.rs
#	mm2src/coins/eth/v2_activation.rs
#	mm2src/coins_activation/src/erc20_token_activation.rs
#	mm2src/coins_activation/src/eth_with_token_activation.rs
@laruh
Copy link
Author

laruh commented Feb 27, 2024

Ive reverted the name of the erc20_token_activation module to minimize conflicts within this module.
Considering the potential for conflicts in other PRs and our uncertainty about whether well continue using the same methods for both eth and nft impls, should we stick with the old name? Alternatively, I could rename it again, perhaps to erc20_nft_token_activation.
@shamardy @onur-ozkan

@shamardy
Copy link
Collaborator

should we stick with the old name? Alternatively, I could rename it again, perhaps to erc20_nft_token_activation

We can leave the old name for now and rename it later.

shamardy
shamardy previously approved these changes Feb 28, 2024
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Only a few non-blockers!

@shamardy
Copy link
Collaborator

shamardy commented Mar 1, 2024

@laruh can you please provide @KomodoPlatform/qa examples for the new enable_nft RPC. You can provide it here post merge or in the NFT issue #900. @KomodoPlatform/qa I think it would be good to make sure that other NFT RPCs work well with and without activation.

@shamardy shamardy merged commit 238a0f2 into dev Mar 1, 2024
@shamardy shamardy deleted the enable-eth-non-fungible-tokens branch March 1, 2024 04:31
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Mar 13, 2024
* dev:
  feat(indexeddb): advanced cursor filtering impl (GLEECBTC#2066)
  update dockerhub destination repository (GLEECBTC#2082)
  feat(event streaming): configurable worker path, use SharedWorker (GLEECBTC#2080)
  fix(hd_tests): fix test_hd_utxo_tx_history unit test (GLEECBTC#2078)
  feat(network): improve efficiency of known peers handling (GLEECBTC#2074)
  feat(nft): enable eth with non fungible tokens (GLEECBTC#2049)
  feat(ETH transport & heartbeats): various enhancements/features (GLEECBTC#2058)
Alrighttt pushed a commit that referenced this pull request Mar 18, 2024
This commit introduces the functionality to enable EVM based coin as a platform coin along with its associated Non-Fungible Tokens (NFTs) owned by user. It includes enable_nft implementation, which works same way as enable_erc20.
Alrighttt added a commit that referenced this pull request Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants