This exeample is meant to illustrate a transaction requiring multiple people's confirmation before the operation is executed. With this MVP example smart-contrat, we show how to use multisig-type confirmation from M of N signers in order to send an operation. In this example, we will bind a call to a token transfer from another smart-contrat, since it’s the most classic use case ( Fungible Asset 2 ).
Step Zero : deploy the contract with desired parameters and bind it to the entrypoint to execute. Each time a multisignature is required :
- A signer proposes a new operation execution with parameters
- M of N possible signers submit an approval transaction to the smart-contrat
- When the last required signer submits their approval transaction and the threshold is obtained, the resulting original transaction of the first signer is executed
Any number of operations can be in valid execution at the same time.
The multisig contract can be invoked to request any operation on other smart contracts.
The multisig
project contains 2 main directories:
src
: contains smart contracts implementation in cameligofa2
- contains implementation of FA2 token used by the multisig contract
You need to install the following tools:
This repository provides a Makefile for compiling and testing smart contracts. One can type make
to display all available rules.
The make all
command will clean all produced smart contracts, then compile smart contracts and then launch tests.
-
The
make compile
command triggers the compilation of smart contracts (advisor and indice). -
The
make test
command launches tests oon compiled smart contracts (advisor and indice). -
The
make deploy
command deploys smart contracts. You need to renamedeploy/.env.dist
todeploy/.env
and fill the required variables.
You can also override make
parameters by running :
make compile ligo_compiler=<LIGO_EXECUTABLE> protocol_opt="--protocol <PROTOCOL>"