Skip to content

Commit

Permalink
Add chainId to project initialiser (#381)
Browse files Browse the repository at this point in the history
* Add chainId to project initializer

* Fix package-lock.json

* Generate powered-by

* update massa-as-sdk to 2.5.4

* Generate powered-by

* Update packages/sc-project-initializer/commands/init/package.json

Co-authored-by: Nathan Seva <thykof@protonmail.ch>

---------

Co-authored-by: massabot <info@massa.net>
Co-authored-by: Nathan Seva <thykof@protonmail.ch>
  • Loading branch information
3 people committed Dec 29, 2023
1 parent 59ad040 commit 67b51e8
Show file tree
Hide file tree
Showing 10 changed files with 1,613 additions and 276 deletions.
127 changes: 114 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions packages/sc-deployer/assembly/contracts/deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import {
functionExists,
hasOpKey,
} from '@massalabs/massa-as-sdk';
import { Args, stringToBytes } from '@massalabs/as-types';
import { setOf } from '@massalabs/massa-as-sdk/assembly/std/storage';
import { Args } from '@massalabs/as-types';

const CONSTRUCTOR = 'constructor';
const PROTO_KEY = 'protoMassa';

/**
* This function deploys and calls the constructor function of the deployed smart contract.
Expand All @@ -23,7 +21,7 @@ const PROTO_KEY = 'protoMassa';
export function main(_: StaticArray<u8>): StaticArray<u8> {
let masterKey = new StaticArray<u8>(1);
masterKey[0] = 0x00;
let protoKey = stringToBytes(PROTO_KEY);

if (!hasOpKey(masterKey)) {
return [];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/sc-deployer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"license": "ISC",
"dependencies": {
"@massalabs/as-types": "^2.0.0",
"@massalabs/massa-as-sdk": "^2.5.2",
"@massalabs/massa-as-sdk": "^2.5.4",
"@massalabs/massa-sc-compiler": "^0.1.0",
"@massalabs/massa-web3": "^3.0.0",
"@massalabs/massa-web3": "^3.0.2",
"@types/node": "^18.11.10",
"assemblyscript": "^0.27.19",
"rimraf": "^5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/sc-deployer/powered-by.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following is a list of all the dependencies of this project:

**License:** (MIT AND Apache-2.0) - perpetual

**Used version:** 2.5.2
**Used version:** 2.5.4

**Many thanks to:** [Massa Labs](info@massa.net)

Expand All @@ -29,7 +29,7 @@ The following is a list of all the dependencies of this project:

**License:** MIT - perpetual

**Used version:** 3.0.0
**Used version:** 3.0.2

**Many thanks to:** [Massa Labs](info@massa.net)

Expand Down
2 changes: 1 addition & 1 deletion packages/sc-project-initializer/commands/init/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
WALLET_SECRET_KEY=""

JSON_RPC_URL_PUBLIC=https://test.massa.net/api/v2:33035
JSON_RPC_URL_PUBLIC=https://buildnet.massa.net/api/v2:33035

0 comments on commit 67b51e8

Please sign in to comment.