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

Feature/multisig sc #120

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3b8cf92
first draft of a multisig smart contract
jcbaillie Aug 12, 2023
e653551
use string for owner addresses to make it easier on the typescript side.
jcbaillie Aug 15, 2023
d1a9aaf
use prefixes before owner and txIndex keys to avoid collisions
jcbaillie Aug 15, 2023
23bf14f
improve documentation, add a ms1_ prefix to multisig functions
jcbaillie Aug 17, 2023
53aac6b
start to add some tests to multisig
jcbaillie Aug 18, 2023
75692fd
more test, use transferCoinsOf instead of transferCoins
jcbaillie Aug 19, 2023
59be132
add a wrapper for multisig
jcbaillie Aug 20, 2023
e119801
rename Transaction->Operation to prepare for generalization to sc calls
jcbaillie Aug 20, 2023
36fc42d
add the possibility to submit sc call operations, not only transactions.
jcbaillie Aug 20, 2023
e4841cc
add a test for multisig call operations
jcbaillie Aug 22, 2023
72100c1
npm run fmt
jcbaillie Aug 22, 2023
a8ab87f
add support for operation cancelling.
jcbaillie Aug 22, 2023
b4de2ec
add a test for operation cancelation by no owner/creator (must fail)
jcbaillie Aug 23, 2023
d7219c0
modify cancellation behavior: now only the operation creator can canc…
jcbaillie Aug 25, 2023
8804665
export isOwner.
jcbaillie Aug 25, 2023
77bbd00
only owners can submit an operation now: fix tests, add comments.
jcbaillie Aug 29, 2023
bec0a89
add a function to query the list of currently pending operation indexes
jcbaillie Sep 5, 2023
09f8a96
add some test, fix a bug in counting certain operations twice in the …
jcbaillie Sep 5, 2023
dcbd4c5
smart contract functions must always return StaticArray<u8>
jcbaillie Sep 6, 2023
d289d7f
fix typo in comments
jcbaillie Sep 7, 2023
d5dcf8a
do not export helper functions, copy them in the test code instead.
jcbaillie Sep 22, 2023
775447a
follow standard name for coin deposit
jcbaillie Sep 22, 2023
a2ef0f5
executeOperation can only be run by owners.
jcbaillie Sep 22, 2023
632d665
Executed operations are kept in storage. Operation cancel is renamed …
jcbaillie Sep 23, 2023
2f4c751
npm run fmt
jcbaillie Sep 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ The [Massa Domain Name Service standard](smart-contracts/assembly/contracts/dns/

This is MassaLabs implementation of [the ENS](https://docs.ens.domains/).

## Multisig

The [Multisig standard implementation](smart-contracts/assembly/contracts/multisig) defines a simple multisig contract able to store funds and release them in a weighted multisig schema (multiple declaration of an owner will increase its weight).

## Massa Units

The [Massa Units standard](units.md) defines a set of common units of measurement for use on the Massa blockchain.
Expand Down
1 change: 1 addition & 0 deletions smart-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [fungible token](assembly/contracts/FT): implementation of the ERC20 token.
- [non-fungible token](assembly/contracts/NFT)
- [multisig](assembly/contract/multisig)

## Documentation

Expand Down
1 change: 0 additions & 1 deletion smart-contracts/assembly/contracts/NFT/NFT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
stringToBytes,
bytesToU256,
u256ToBytes,
boolToByte,
u32ToBytes,
} from '@massalabs/as-types';
import { u256 } from 'as-bignum/assembly';
Expand Down
3 changes: 2 additions & 1 deletion smart-contracts/assembly/contracts/NFT/__tests__/NFT.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import { u256 } from 'as-bignum/assembly';

const callerAddress = 'A12UBnqTHDQALpocVBnkPNy7y5CndUJQTLutaVDDFgMJcq5kQiKq';

const userAddress = 'A12BqZEQ6sByhRLyEuf0YbQmcF2PsDdkNNG1akBJu9XcjZA1e8';
// never used
// const userAddress = 'A12BqZEQ6sByhRLyEuf0YbQmcF2PsDdkNNG1akBJu9XcjZA1e8';

const NFTName = 'MASSA_NFT';
const NFTSymbol = 'NFT';
Expand Down
2 changes: 2 additions & 0 deletions smart-contracts/assembly/contracts/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as FT from './FT';
import * as NFT from './NFT';
import * as multisig from './multisig';
import * as ownership from './utils/ownership';

export { FT };
export { NFT };
export { multisig };
export { ownership };
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="@as-pect/assembly/types/as-pect" />
Loading
Loading