Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract delegate #5

Open
Turupawn opened this issue Sep 8, 2023 · 2 comments
Open

Contract delegate #5

Turupawn opened this issue Sep 8, 2023 · 2 comments

Comments

@Turupawn
Copy link
Member

Turupawn commented Sep 8, 2023

Abstract

Devs, delegates and researchers are needed for creating a system where token holders delegate to a Smart Contract instead of a single delegate EOA.

Context

What if instead of delegating to a specific delegate we delegate to a more complex organization? At present time, SEED Latam is a complex organization composed of many researchers and a delegate that executes votes on chain and delegators choose to delegate to the delegator that SEED Latam proposes because they trust SEED Latam judgement. I think other organizations like this are to come so we need contracts that help expressing what really happens in such organizations.

Delegating to a Smart Contract can unlock stuff such as a delegate retiring gracefully, taking vacations or a community bypassing a delegate vote.

What is needed

I think a first MVP can be a Smart Contract where people delegate to, and where a multisig can choose a Delegate. Only the delegate should be able to execute castVote functionon on that Smart Contract.

@Turupawn
Copy link
Member Author

Turupawn commented Sep 9, 2023

I started working on this, I have a very rudimentary version that can serve as an MVP
https://github.com/Turupawn/Delegatable

@Turupawn
Copy link
Member Author

Turupawn commented Sep 25, 2023

Updates:

1. Successful DelegatableZero trial launch

The DelegatableZero contract is a very naive Delegatable Contract implementation where the contract owner (in this case me, but can be something like a multisig) can decide who the delegate through setDelegate is (in this case Joxes) who can cast votes. So token holders can delegate to the smart contract and the delegator can execute castVote from within the contract to use it's voting power. To test it we did the following:

  1. I launched the DelegatableZero contract
  2. I Set Joxes as Delegate
  3. The Agora team helped us by making a dummy proposal in their Governance test contract deployed on Optimism Mainnet
  4. delegated to the DelegatableZero contract
  5. and finally Joxes casted a vote
contract DelegatableZero is Ownable {
    address public delegate;

    constructor() Ownable(msg.sender) {}

    function setDelegate(address delegate_) public onlyOwner {
        delegate = delegate_;
    }

    function castVote(
        address governorAddress,
        uint256 proposalId,
        uint8 support,
        string calldata reason) public {
        require(msg.sender == delegate, "Only delegate can cast votes");
        IGovernor(governorAddress).castVoteWithReason(proposalId, support, reason);
    }
}

2. We need a name for this project

We need a name that:

  • Makes it clear that this is for helping expressing on-chain the mechanics of an Governance Organization such a Seed latam
  • Stands apart of other projects where you would want to delegate to or from a smart contract, such as Liquid delegation alternatives

Having a good name would help to explain more efficiently what we're doing

3. The Alligator

@yitongzhang , who helped us maiking the dummy proposal for the DelegatableZero contract, also recommended to us to checkout the Alligator contract, although the Alligator contract purpose is serve as a better alternative to liquid delegation, it has the codebase for making that a contract interacts with the Governor as a Proxy. It would be nice to use the same codebase as a library or abstract contract that we can extend and have all different available castVote alternatives.

4. Moving on

Next steps are:

  • Testing this in other governor contracts
  • Try to implement the Alligator contract as an abstract contract library
  • Start experimenting with expressing SEED latam internal mechanics on solidity
  • ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant