Skip to content

Eth sent to Timelock will be locked in current implementation #150

@JSeam2

Description

@JSeam2

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)

  1. Send eth to timelock contract
  2. 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"
    );
  1. Vote and have the proposal succeed.
  2. 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
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions