I came across this problem while playing around with the new governance contracts.
Here's what I did
Setup the governance contracts (Comp, GovernorBravoDelegate, GovernorBravoDelegator, Timelock)
- Send eth to timelock contract
- Setup a proposal to send 0.1 eth out. Code snippet in ether.js below.
proxy refers to GovernorBravoDelegator instance using GovernorBravoDelegate's abi.
await proxy.propose(
[signers[3].address],
[ethers.utils.parseEther("0.1")],
[""],
[ethers.BigNumber.from(0)],
"Send funds to 3rd signer"
);
- Vote and have the proposal succeed.
- Execute the proposal, the proposal number here is arbitrary.
await proxy.execute(2); // this fails
await proxy.execute(2, {value: ethers.utils.parseEther("0.1")}) // this would work
- 0.1 eth will be sent out, but it is sent from the
msg.sender not from the timelock contract
Changing this line on GovernorBravoDelegate will address the issue and allow for eth in the Timelock contract to be sent out.
// Before
timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
// After, don't duplicate the proposal.values[i]
timelock.executeTransaction.value(0)(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
The solution I found above is definitely not ideal, any other ideas appreciated.
I came across this problem while playing around with the new governance contracts.
Here's what I did
Setup the governance contracts (Comp, GovernorBravoDelegate, GovernorBravoDelegator, Timelock)
proxyrefers to GovernorBravoDelegator instance using GovernorBravoDelegate's abi.msg.sendernot from the timelock contractChanging this line on GovernorBravoDelegate will address the issue and allow for eth in the Timelock contract to be sent out.
The solution I found above is definitely not ideal, any other ideas appreciated.