The parameters for burn
are redundant
#15
Labels
effort: high
Large or difficult task.
priority: 1
This is important. It should be dealt with shortly.
type: refactor
Change that neither fixes a bug nor adds a feature.
work: complicated
Sense-analyze-respond. The relationship between cause and effect requires analysis or expertise.
Copy-pasting the criticism shared by @IaroslavMazur here:
Note that because:
the tokens that are to be burned will have to be transferred by the
holder
in the tx that, ultimately, triggers our Precompile to burn them.I've checked out the SRF-2: Mint and Burn standard, and here's how I envision this would work:
burn()
function of the SRF-2 contract, transferring (just) the contract-associated tokens to be burned,In this context,
amount
argument to the SRF-2 contract is redundant, as this information can be deduced from the tokens effectively transferred in the current tx;holder
argument is redundant, as everyholder
may only burn the tokens they own themselves;sub_id
argument should, actually, betoken_id
. An argument for this would be that when a user wants to transfer the token in a tx, they'd need to specify thetoken_id
- and it'd be wrong to expect/ask the users to keep in mind both thesub_id
and thetoken_id
of each of the tokens they use.Another thing worth noting here is that because we won't have total control upon the implementation of the SRF-2 contracts, we won't be able to guarantee that the contracts behave correctly in terms of how much they, actually, burn, etc. However, this is similar to how it's, currently, not the responsibility of Ethereum to validate and approve the logic inside the ERC-20 contract deployed to the blockchain.
Why output both the
token_id
and thesub_id
in the emitted Receipt, though? Thetoken_id
is the only thing that should be present there, IMO.The text was updated successfully, but these errors were encountered: