Badger-Finance / gitcoin

Repo for gitcoin hack-a-thons,bonunties and code snippets.
7 stars 0 forks source link

Allow sign_message to work with Ledger/Clef in Brownie #19

Closed Tritium-VLK closed 2 years ago

Tritium-VLK commented 2 years ago

We want to be able to use our ledgers through brownie and clef to sign multisig transactions and submit them to gnosis.

We've found this: https://eth-brownie.readthedocs.io/en/stable/account-management.html#using-a-hardware-wallet

With it we have gotten our ledger attached to clef. We have figured out how to set account.default to the correct wallet and can use it to submit transactions.

The problem is that gnosis requires us to sign and send messages over an API.

Directly above the docs on how to use a hardware wallet is how to sign a message: https://eth-brownie.readthedocs.io/en/stable/account-management.html#using-a-hardware-wallet

The account.sign_message() function is only implemented in LocalAccount, and there is no way to load a Clef, of type ClefAccount into a LocalAccount (which makes sense).

This bounty is to adapt the ClefAccount class https://eth-brownie.readthedocs.io/en/stable/api-network.html#brownie.network.account.ClefAccount to be functionally identical to a LocalAccount or at least able to sign messages. In the end we should be able to send and sign messages to the gnosis API using our ledger.

Please come see us on our Dev DIscord for more detailed examples of how we are trying to use this.

This bounty, of $5000, will be paid out to the person who submitted a merged pull requested that resulted in a published version of brownie (latest or stable tagged) which we can use to sign messages with our ledger. We have a lot of wants, needs and desires for brownie and would be happy to continue paying contributors to build out missing features we need.