Hi - wondering how to accomplish a seemingly easy task using a DAO Governor/Timelock/ERC20 setup. I've deployed a DAO to Polygon. The timelock contract is our treasury and I've sent both MATIC and some of our ERC20 token to the treasury. It seems to be really easy to transfer MATIC out to an EOA (using Tally to propose, etc), but I want to test getting ERC20 tokens out too and that seems to be tricky to me. Shouldn't I be able to create a proposal to do this from Defender?
It's the process that's stumping me. In Defender I attempted to add a proposal for a transferFrom on our ERC20 contract - the from account being the timelock and the recipient being an EAO, specifically a multisig also belonging to the DAO.
Defender responded that the transaction would fail - so I'm assuming I'm not talking to the contracts the right way. I attempted it using an Execution Strategy from the Governor and even from the EOA I used for deployment. No go. So how should I be doing this?
Neither the Governor or the Timelock contracts display a "Transfer" or TransferFrom" function in Defender. So how does one accomplish this - I mean, our treasury will probably eventually have multiple ERC20 tokens in it. How do we create proposals to get them out?
You need to create a proposal to execute the
transfer function on the ERC20 contract, not
In Defender you should use the Governor as execution strategy.
That isn't working for me. I've got 8,000,000 ERC20 tokens that belong to my timelock contract. As instructed, I chose "transfer", picked my address to send the ERC20 tokens to, then chose the Governor as my execution strategy, and no matter what amount I attempt to send, it displays an error msg at the bottom that
Error: Transaction would revert: ERC20: transfer amount exceeds balance
I went to polygonscan and did a balanceOf the timelock address in the ERC20 contract & it says it has 8 million tokens. I was attempted to transfer 1 mill of the balance belonging to the treasury contract as a test. Also tried several smaller amounts. Transferring using the method you've described doesn't work for me. I'm totally stuck and need help.
There is a bug in how Defender tries to check whether the transaction would revert. In this case it's causing an error where there may not be one.
You should go ahead and submit the proposal anyway.
I'm talking with the Defender team to understand when this bug would be fixed.
The bug is definitely real. It wouldn't go thru even though I forced it passed it's warning. I apologize that I didn't do a screen capture of the error msg! Metamask went away after I signed the Tx and I was left with an error about something being wrong with a json file. That's all I remember. Sorry I didn't grab a copy.
So... after that I tried it on Tally instead and it went thru, so I think there is a Defender issue.