Skip to content

Commit

Permalink
Update max_gas and max_coins for deployment (#374)
Browse files Browse the repository at this point in the history
* Update max_gas and max_coins for deployment

* Update dependencies and fix migration to massa v27

* Generate powered-by

* Update sc-deployer to 1.1.3

* Update compiler

* Generate powered-by

* Update sc-deployer to use the new compiler and massa-as-sdk version

* Generate powered-by

* Bump massa-web3

* Generate powered-by

---------

Co-authored-by: massabot <[email protected]>
  • Loading branch information
Ben-Rey and massabot authored Nov 16, 2023
1 parent bfaa77f commit c066a56
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 27,718 deletions.
113 changes: 97 additions & 16 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions packages/massa-proto-cli/powered-by.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ The following is a list of all the dependencies of this project:

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

**Used version:** 2.4.0
**Used version:** 2.5.2

**Many thanks to:** [Massa Labs]([email protected])

## [@massalabs/massa-web3](git+https://github.com/massalabs/massa-web3.git)

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

**Used version:** 2.2.1
**Used version:** 2.2.3

**Many thanks to:** [Massa Labs]([email protected])

Expand Down
10 changes: 5 additions & 5 deletions packages/sc-deployer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@massalabs/massa-sc-deployer",
"version": "1.1.2",
"version": "1.1.3",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -12,10 +12,10 @@
"author": "",
"license": "ISC",
"dependencies": {
"@massalabs/as-types": "^1.0.1",
"@massalabs/massa-as-sdk": "^2.4.0",
"@massalabs/massa-sc-compiler": "^0.0.4-dev",
"@massalabs/massa-web3": "^2.2.1",
"@massalabs/as-types": "^2.0.0",
"@massalabs/massa-as-sdk": "^2.5.2",
"@massalabs/massa-sc-compiler": "^0.1.0",
"@massalabs/massa-web3": "^1.24.4",
"@types/node": "^18.11.10",
"assemblyscript": "^0.25.2",
"rimraf": "^5.0.1",
Expand Down
14 changes: 7 additions & 7 deletions packages/sc-deployer/powered-by.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# Dependencies Report

The following is a list of all the dependencies of this project:
## [@massalabs/as-types](https://registry.npmjs.org/@massalabs/as-types/-/as-types-1.1.0.tgz)
## [@massalabs/as-types](https://registry.npmjs.org/@massalabs/as-types/-/as-types-2.0.0.tgz)

**License:** ISC - perpetual

**Used version:** 1.0.1
**Used version:** 2.0.0

**Many thanks to:**

## [@massalabs/massa-as-sdk](git+https://github.com/massalabs/massa-as-sdk.git)

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

**Used version:** 2.4.0
**Used version:** 2.5.2

**Many thanks to:** [Massa Labs]([email protected])

## [@massalabs/massa-sc-compiler](https://registry.npmjs.org/@massalabs/massa-sc-compiler/-/massa-sc-compiler-0.0.4-dev.20230227095655.tgz)
## [@massalabs/massa-sc-compiler](https://registry.npmjs.org/@massalabs/massa-sc-compiler/-/massa-sc-compiler-0.1.0.tgz)

**License:** ISC - perpetual

**Used version:** 0.0.4-dev.20230227095655
**Used version:** 0.1.0

**Many thanks to:**

## [@massalabs/massa-web3](git+https://github.com/massalabs/massa-web3.git)

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

**Used version:** 2.2.1
**Used version:** 1.24.4

**Many thanks to:** [Massa Labs]([email protected])

Expand Down
4 changes: 2 additions & 2 deletions packages/sc-deployer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function awaitOperationFinalization(
.smartContracts()
.awaitRequiredOperationStatus(
operationId,
EOperationStatus.FINAL_SUCCESS,
EOperationStatus.SPECULATIVE_SUCCESS,
);
console.log(
`Transaction with Operation ID ${operationId} has reached finality!`,
Expand All @@ -116,7 +116,7 @@ async function awaitOperationFinalization(
throw ex;
}

if (status !== EOperationStatus.FINAL_SUCCESS) {
if (status !== EOperationStatus.SPECULATIVE_SUCCESS) {
let msg = `Transaction ${operationId} did not reach finality after considerable amount of time.`;
msg +=
'Please review the transaction logs to identify potential issues or try redeploying a new contract';
Expand Down
13 changes: 6 additions & 7 deletions packages/sc-deployer/src/utils/maxCoins.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { fromMAS } from '@massalabs/massa-web3';
import { ISCData } from '../interfaces';

const BASE_ACOUNT_CREATION_COST = fromMAS(0.01);
const PRICE_PER_BYTE = fromMAS(0.001);

import {
BASE_ACCOUNT_CREATION_COST,
STORAGE_BYTE_COST,
} from '@massalabs/massa-web3';
/**
* Estimates the value of the maxCoins maximum number of coins to that should be used while deploying a smart contract.
*
Expand All @@ -17,8 +16,8 @@ export function calculateMaxCoins(
coinsSent: bigint,
) {
return (
BASE_ACOUNT_CREATION_COST +
contractByteCodeSize * PRICE_PER_BYTE +
BASE_ACCOUNT_CREATION_COST +
contractByteCodeSize * STORAGE_BYTE_COST +
coinsSent
);
}
Expand Down
Loading

0 comments on commit c066a56

Please sign in to comment.