Replies: 2 comments 7 replies
-
TL;DR: Aurora EVM has the same problem, and it is just an isolated environment without native connection to the rest of NEAR ecosystem I feel JS enclave will need some sort of bridging since P.S. Thinking a bit more about it, I feel there will be a need in having a standard defining how to wrap the function calls for JS enclave, so |
Beta Was this translation helpful? Give feedback.
-
Perhaps using multi-token standard will be a consideration for supporting this for enclaves, with some mapping of token ids to the addresses of the tokens on the contract? Aside from that, unclear how this can be done for enclaves since there is no way to distinguish which token balance is viewed through something like For interacting with the contract, you could deploy a wrapper |
Beta Was this translation helpful? Give feedback.
-
I wanted to discuss how standards would come into play with the JS SDK. Generally, it is expected that the methods outlined within the standards (i.e
nft_transfer
,ft_transfer_call
,nft_supply_for_owner
etc..) are implemented on the contract itself.This is made apparent in nomicon sections that state, for example, "Contracts which want to make use of nft_transfer_call must implement the following:" or "The contract must implement the following view methods:" etc...
Let's look at a common scenario to see why this is a problem. Let's say you have a dApp that wants to list all NFT contracts and allow users to paginate through NFTs for any given contract similar to SecondX. The dApp will keep a list of NFT contracts and then paginate using
nft_tokens
by calling the contract directly. If there's a JS contract in there, this will not work since in order to call the JS contract, you need to go through the enclavejsvm.testnet
first and the way you call these methods is different since you need to base64 encode the arguments unlike how you would interact with conventional smart contracts.I'm honestly not even sure how you would integrate the events standard since the
jsvm
contract will be emitting all those events. Say you had 100 different NFT contracts all written in JS that all were all deployed to the samejsvm.testnet
account. If all of them have events being fired, the indexers will think that all the NFTs belong to thejsvm.testnet
account and it won't be able to associate which NFTs come from which contracts. All the NFTs will get mixed up and you might also run into the case where there's duplicate token IDs.I also wanted to mention the idea of the storage management standard since users will all be sharing the same root
jsvm.testnet
account and have their contracts live there. How will $NEAR payouts be handled if you're using a JS contract? Does everybody have access to the funds stored on thejsvm.testnet
account or is it segregated and a specific usable amount is allocated to each contract that gets populated whenever someone transfers funds and is interacting with that specific contract?Please let me know your thoughts on these issues as I think they're extremely important to consider.
Beta Was this translation helpful? Give feedback.
All reactions