Remove association requirement for entities that only atomically custody HTS tokens #696
Replies: 1 comment
-
Thanks for starting this discussion @littletarzan its a good one to have. I am curious to see what the rest of the community thinks about this. My take- Pros: Enhanced interoperability: I see both sides here. This proposal brings Hedera closer to Ethereum feature parity, but because we are different networks, it might not always be the best approach to achieve exact parity. Encourages trustless transfers: By removing the association requirement for internal transactions with net zero balances, smart contracts can facilitate trustless transfers of tokens between parties more efficiently, ultimately promoting growth. Cons: Maintenance overhead: Implementing this proposal would require modifications to the existing Hedera Smart Contract Service, which could introduce additional maintenance overhead for Engineering. Potential abuse: There might be a risk of malicious actors taking advantage of the relaxed association requirements to manipulate token custody, although this could be mitigated by ensuring proper checks at the end of a contract call. So this part would need very careful consideration So tldr: Its cool but could be dangerous so carefully thinking through the implementation is crucial. @Nana-EC what do you think about this proposal? |
Beta Was this translation helpful? Give feedback.
-
Introduction
Smart contracts are required to be associated with all tokens they custody. This makes sense when the contract has a long lived balance > 0; Hedera state is expanded and must be paid for in ongoing maintenance and storage costs to the network. However, there are many use cases that call for smart contracts atomically taking custody of a token, often to transfer to another entity within the same contract call. In this case, association is still required but Hedera state is not expanded. We propose the idea and eventual HIP that association not be required for Hedera entities that only custody a token during an atomic transaction.
Motivation
Smart contracts are often used to facilitate trustless transfer of tokens between parties, i.e. decentralized exchanges (DEXes). The DEXes on Hedera have different approaches to this. SaucerSwap uses delegatecall to avoid its router contract self-custodying tokens, HeliSwap optimistically associates tokens to its router contract for liquidity removal, and Pangolin's router associates and dissociates tokens to its router for liquidity removal.
0x167
cannot be delegatecalled.Proposed Solution
Hedera Smart Contract Service optimistically allows custody of any token for any entity, and checks at the end of a contract call that tokens are associated to entities whose balance is changing from zero to nonzero.
Beta Was this translation helpful? Give feedback.
All reactions