Etherlime
Search…
Migration from v1.2 to v2.0

Breaking Changes

TLDR:

In your project run:
1
npm i etherlime-lib
Copied!
Wherever you have require('etherlime') you now need to change to require('etherlime-lib'). You can safely uninstall your project version of etherlime npm uninstall etherlime.
Note: Do reinstall the global CLI version of etherlime: npm uninstall -g etherlime, npm install -g etherlime

Installing v2.0

Installing the CLI:

1
npm i -g etherlime
Copied!
This command in v2.0 will install only the etherlime CLI - (command line interface) library. You can use all the CLI commands.

Installing the LIB:

1
npm i etherlime-lib
Copied!
This command will install only etherlime LIB . You can use LIB to deploy, instantiate or test smart contracts.

Deploying in v1.2

Deploying in v1.2 is as follows:
Example:
1
const etherlime = require('etherlime');
2
3
// Path to your etherlime compiled contract json file
4
const TestContract = require('../build/TestContract.json');
5
6
const deploy = async (network, secret) => {
7
8
const deployer = new etherlime.EtherlimeGanacheDeployer();
9
10
// Add params separated with ,
11
const result = await deployer.deploy(TestContract, {});
12
}
13
14
module.exports = { deploy }
Copied!
Please note that here etherlime is required as etherlime.

Deploying in v2.0

Deploying in v2.0 is as follows using Etherlime LIB.
Example:
1
const etherlime = require('etherlime-lib');
2
3
// Path to your etherlime compiled contract json file
4
const TestContract = require('../build/TestContract.json');
5
6
const deploy = async (network, secret) => {
7
8
const deployer = new etherlime.EtherlimeGanacheDeployer();
9
10
// Add params separated with ,
11
const result = await deployer.deploy(TestContract, {});
12
}
13
14
module.exports = { deploy }
Copied!
Please note that here etherlime is required as etherlime-lib.

Testing Smart Contracts v1.2

1
const etherlime = require('etherlime');
2
const Billboard = require('../build/Billboard.json');
3
4
describe('Example', () => {
5
let owner = accounts[3];
6
let deployer;
7
8
beforeEach(async () => {
9
deployer = new etherlime.EtherlimeGanacheDeployer(owner.secretKey);
10
});
11
12
it('should set correct owner', async () => {
13
const BillboardContract = await deployer.deploy(Billboard, {});
14
let _owner = await BillboardContract.owner();
15
16
assert.strictEqual(_owner, owner.signer.address,
17
'Initial contract owner does not match');
18
});
19
});
Copied!
Please note that here etherlime is required as etherlime.

Testing Smart Contracts v2.0

1
const etherlime = require('etherlime-lib');
2
const Billboard = require('../build/Billboard.json');
3
4
describe('Example', () => {
5
let owner = accounts[3];
6
let deployer;
7
8
beforeEach(async () => {
9
deployer = new etherlime.EtherlimeGanacheDeployer(owner.secretKey);
10
});
11
12
it('should set correct owner', async () => {
13
const BillboardContract = await deployer.deploy(Billboard, {});
14
let _owner = await BillboardContract.owner();
15
16
assert.strictEqual(_owner, owner.signer.address,
17
'Initial contract owner does not match');
18
});
19
});
Copied!
Please note that here etherlime is required as etherlime-lib.