Hello,
In Ethereum the ERC20 token operations are handled through a smart contract. For example if you want to transfer some ERC20 tokens from account A to account B, account A needs to call the transfer() function.
Some ERC20 tokens not only transfer the token through changing balances in the contract’s storage upon calling the transfer() function, but also do other stuff. A common example is that if the ERC20 is used for voting the transfer(), will also check that the tokens that are being transferred already voted. This is used to prevent voting, transferring and voting again.
Now in Fuel because of the UTXO model, the SRC20 Coin transfer happens independently of the contract that minted the SRC20 Coins and hence there is no way to implement additional operations during transfer of Assets.
Can the above ERC20 transfer mechanism from Ethereum be somehow enforced for SRC20 in Fuel, or is this something that is impossible?
Note that it would be possible with NFTs, as every NFT would have total_supply of 1 and if a user votes (which would happen through a contract call) we could store the unique id of the NFT (the AssetID) and hence prevent voting twice.
But would that be possible with fungible SRC20 Assets?
Regards,
JecikPo