@massalabs/sc-standards v0.1.1
Massa Smart-contract Standards
- fungible token: implementation of the ERC20 token.
- non-fungible token
Documentation
Complete documentation of all available functions and objects is here:
Usage
Install
npm i @massalabs/sc-standards
Example
import { Args } from '@massalabs/as-types';
import { callerHasWriteAccess } from '@massalabs/massa-as-sdk';
import * as FT from '@massalabs/sc-standards/assembly/contracts/FT/index';
export * from '@massalabs/sc-standards/assembly/contracts/FT/token';
/**
* This function is meant to be called only one time: when the contract is deployed.
*
* @param _ - not used
*/
export function constructor(_: StaticArray<u8>): StaticArray<u8> {
// This line is important. It ensures that this function can't be called in the future.
// If you remove this check, someone could call your constructor function and reset your smart contract.
if (!callerHasWriteAccess) {
return [];
}
FT.constructor(
new Args().add('MY_TOKEN').add('MTK').add(4).add(100000).serialize(),
);
return [];
}
1 month ago
2 months ago
3 months ago
4 months ago
4 months ago
5 months ago
10 months ago
10 months ago
10 months ago
6 months ago
10 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
10 months ago
10 months ago
9 months ago
9 months ago
8 months ago
11 months ago
10 months ago
9 months ago
6 months ago
6 months ago
9 months ago
10 months ago
11 months ago
6 months ago
6 months ago
10 months ago
10 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago