Skip to content

klaytn/contract-template

Repository files navigation

Contract-template

This template provides a template for contract development and operation, including tools and conventions. If you have a suggestion, please make a PR to the template.

After clone

There are a few things that MUST be done after a new repo has been created using this template.

  • Update package.json by running npm init
  • Things to remove
    • deployments/
    • lib/hardhat/index.ts
  • Writing docs from template

Quickstart

See GETTING-STARTED for details.

Prerequisites

From your hardhat project, run:

npm install @klaytn/contract-template

Import abi, address from typescript/javascript

import { Counter } from "@klaytn/contract-template";

async function main() {
  console.log(Counter.address, Counter.abi.substring(0, 16));
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Import from solidity

import "@klaytn/contract-template/contracts/Counter.sol";

What's Included?

Tools

Files

  • Sample contracts in contracts/
  • Sample hardhat-deploy scripts in deploy/
  • Sample library functions in lib/
  • Sample scripts in script/
  • Sample tests in test/
  • Document templates (README-TEMPLATE.md, GETTING-STARTED-TEMPLATE.md)
  • Sample configurations (hardhat.config.ts, foundry.toml)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published