Supersig is a multisig written in vyper. It can be used in coordination with the supersig frontend.
The motivation for writing the supersig contract itself is to help avoid monoculture around decentralized tools. Vyper was specifically chosen as most multisig tooling is currently written in Solidity.
At this point in time this repo is a proof of concept. The mechanism design can be improved, and the code has not been closely reviewed. It is unit tested using ApeWorx, and it does work in a very basic sense.
At a high level, Supersig works like this:
- You deploy
supersig
with a list of owners and a minimum number of approvals (can be done via UI) - Someone
propose
's a proposal- a proposal is very simple. It consists of an id, which is a number, and a proposal hash.
- a proposal hash is a 32 byte commitment to the intended transaction. The commitment is
keccak256(target_address . target_calldata . target_transaction_value)
- Owners call
approve
on a proposal ID - Someone
executes
the proposal, providing the full intended transaction. The proposal only executes if thekeccak256
of the provided transaction matches the proposed commitment hash.
The intent of Supersig is to keep all approval and proposal actions on-chain, without revealing the intent of the proposal until it's executed.
Supersig was written as part of the ETHNYC 2022 Hackathon. It uses Apeworx, Vyper, Pokt, and Privy who were among the awesome sponsors of the event.
For an offline, EIP712-based multisig in vyper, also see ricobank/multisig
Recommend using miniconda
- Create a new environment and activate
$> conda create --name supersig python==3.10.4
$> conda activate supersig
- Install apeworx
$> (supersig) python -m pip install -U pip
$> (supersig) python -m pip install eth-ape
$> (supersig) ape plugins install vyper
- Make sure stuff works
$> ape test
========================================== test session starts ===========================================
platform darwin -- Python 3.10.4, pytest-7.1.2, pluggy-0.13.1
rootdir: /Users/Dan/scontract/supersig
plugins: eth-ape-0.3.3, web3-5.29.2
collected 15 items
tests/test_supersig.py ............... [100%]
========================================== 15 passed in 19.94s ===========================================
(assumes you have a wallet with some Testnet eth)
- Import the wallet to ape and give it the
testnet
$> (supersig) ape accounts import testnet
- Create three signer addresses for testing
$> (supersig) ape accounts generate signer1
$> (supersig) ape accounts generate signer2
$> (supersig) ape accounts generate signer3
- Run deploy job
$> (supersig) ape run scripts/deploy_testnet.py --network ethereum:rinkeby