@ikalasdev/timelock
v1.0.2
Published
Interact with a Timelock smart contract.
Downloads
4
Readme
TimelockCreator
Timelock creator is a library that allow you to get the ABI, the bytecode and the sourcecode of a Timelock smart contract. You can also deploy immediatly a contract on a blockchain.
Prerequirements:
This is a Node.js module available through the
npm registry.
Before installing, download and install Node.js.
If this is a brand new project, make sure to create a package.json
first with
the npm init
command.
Installation
- This module need to be in a hardhat project.
create hardhat project with
npm install hardhat --save-dev
npx hardhat
- install the module using
npm install @ikalasdev/timelock
check soldity compiler version is >= 0.8.0 in hardhat.config.js
By default, the basic hardhat project include hardhat-waffle. If this requirement is missing, this at the begining of the hardhat.config.js file:
require('@nomiclabs/hardhat-waffle')
and download the library with :
npm install @nomiclabs/hardhat-waffle
Network
For this library there is no needs to setup the network.
Examples
Create the contract
With promises :
const timelock = require("@ikalasdev/timelock");
timelock.create().then(function(result) {
console.log(result.abi);
console.log(result.bytecode);
console.log(result.contract);
});
with async function :
const timelock = require("@ikalasdev/timelock");
async function GetInformations()
{
var result = await timelock.create();
console.log(result.abi);
console.log(result.bytecode);
console.log(result.contract);
}
GetInformations();
Deploy a Timelock contract
With promises :
const timelock = require("@ikalasdev/timelock");
timelock.deploy().then(function(result) {
//do what ever you what
});
with async function :
const timelock = require("@ikalasdev/timelock");
async function DeployContract()
{
await timelock.deploy();
}
DeployContract();