This project contains the Multisig wallet implementation on Ligo that enables both.
.
├── contracts/ # contracts
├── testSrc/ # test cases
├── storage/ # initial storage for contract origination
├── README.md # current file
├── .gitignore
├── package.json
- Installed NodeJS (tested with NodeJS v12+)
- Installed Truffle:
npm install -g truffle@tezos
- Installed ganache-cli:
npm install -g ganache-cli@tezos
- Installed Ligo:
curl https://gitlab.com/ligolang/ligo/raw/dev/scripts/installer.sh | bash -s "next"
- Installed node modules:
cd tezos-multisig && yarn
- Configure
truffle-config.js
if needed.
To compile and deploy contracts to Delphinet run:
yarn migrate-delphinet
For the development network:
yarn migrate # development
Contracts are processed in the following stages:
- Compilation
- Deployment
- Configuration
- Interactions on-chain
To compile the contracts run:
yarn compile
Artifacts are stored in the build/contracts
directory.
For deployment step the following command should be used:
yarn migrate
Addresses of deployed contracts are displayed in terminal.
For other networks:
yarn migrate-delphinet
The main contract is Multisig
with the following interface:
type operator_info is record [
allowed : bool;
manager : address;
]
type proposal_info is record [
actions : unit -> list(operation);
approve : bool;
expired : nat;
]
type action is
| Control of operator_info
| Propose of proposal_info
| Default of unit
| Approve of nat
| Execute of nat
| Require of nat
The entrypoint is used to add or remove the new wallet managers. Can only be called by the wallet itself.
allowed
: whether add or remove the maanger;
manager
: address of the updated manager.
The entrypoint is used to set the required number of confirmmations. Can only be called by the wallet itself.
count
: required amount of proposal confirmations to enable execution.
The entrypoint to receive XTZ payments. No parameters are required.
The entrypoint is used to propose the specific operations to be executed. Can only be called by mangers.
actions
: lambda that returns the operations that should be executed;
approve
: whether the sender confirms the proposal;
expired
: the time until the proposal is valid and can be executed.
The entrypoint is used to approve the specific proposal. Can only be called by mangers.
id
: identifier of the proposal to be approved.
The entrypoint is used to execute the specific approved proposal. Can only be called by mangers.
id
: identifier of the proposal to be executed.
Truffle framework is used for testing. Run:
yarn test
NOTE: if you want to use a different provider, configure truffle-config.js
.
More info about test coverage in tests.md