Created a ERC-20 token that is governed by a time lock and a multisig
I managed to make a mint proposal, it was signed, delayed by the time lock and executed.
When I tired to test the burn method, it fails.
Environment
multisig
time lock
mainnet (testnet worked)
Details
When i try to burn the minted tokens, the time lock fails the operation.
This is error i get "Error: Timelock execution would revert. Error: Transaction would revert: ERC20: burn amount exceeds allowance"
I minted 0.000000000000001000 new tokens -> they belong to the token smart contract it self.
(on the mint amount i chose 1000 - and it actually minted 1/10^15 of a token, on an 18 decimal token)
when trying burn the same amount of token i just minted i get the error "Error: Timelock execution would revert. Error: Transaction would revert: ERC20: burn amount exceeds allowance"
Looking at the code, i see we can't burn all the token but only a smaller amount
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance")
I tried with a small amount "999" and it failed again
Yes, I am trying to burn the tokens on that are allocated to the token contract, and the token contract is owned by the time lock smart contract.
The first proposal of minting using the MultiSig -> Time Lock -> Token was executed properly.
I am trying to do the "opposite" test by trying to call the burnFrom the tokens i minted.
I keep getting this message Error: Timelock execution would revert. Error: Transaction would revert: ERC20: burn amount exceeds allowance
Hi @nirhy! Even if the Timelock contract owns the token contract, if you want the Timelock to burn tokens owned by an account you need to previously authorize the Timelock to do so by calling approve(spender, amount) on the token contract, where spender in this case is the Timelock address and amount is the maximum amount of tokens you'll authorize it to burn. The sequence would be more or less (pseudocode):
The revert message you're getting happens if in line 4 of the pseudocode above you try to burn a number greater than the one approved in line 3 (in this case, 100).
Note 1: you can use Defender Admin to run step 3 as well: just create a custom admin action to call approve on the token contract from the account that owns the tokens to be burned and setting the spender argument to your timelock address.
Note 2: If, on the other hand, what you're trying to do is to burn tokens the Timelock itself holds, you should be calling burn instead of burnFrom.
I minted 0.000000000000001000 new tokens -> they belong to the token smart contract it self.
You can't burn an account's tokens without its permission, and given the account in this case is the token contract itself, you'd need to add some code to let the owner trigger a burn of the token contract's tokens (assuming your token contract is upgradeable).
All of the above of course provided I understood your situation correctly, let me know otherwise.