@ikalasdev/timelock

1.0.2 • Public • Published

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

  1. This module need to be in a hardhat project.
    create hardhat project with
npm install hardhat --save-dev
npx hardhat
  1. 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();

Readme

Keywords

none

Package Sidebar

Install

npm i @ikalasdev/timelock

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

743 kB

Total Files

12

Last publish

Collaborators

  • lechiffre4
  • tlbail
  • malik-ikalas