Repository for P2Pix EVM contracts to be imported by the project.
Go to file
PedroCailleret b1fe0a574c refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.husky refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.yarn refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
artifacts/contracts refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
contracts refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
deploys refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
scripts refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
src/types refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
test refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.commitlintrc.yaml refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.czrc refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.editorconfig refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.env.example refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.eslintignore refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.eslintrc.yaml refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.gitignore refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.lintstagedrc refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.prettierignore refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.prettierrc.yaml refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.solcover.js refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.solhint.json refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.solhintignore refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.yarnrc.yml refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
LICENSE Initial commit 2022-10-24 14:17:08 -03:00
README.md refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
hardhat.config.ts refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
package.json refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
tsconfig.json refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
yarn.lock refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00

README.md

p2pix-smart-contracts

Repository for P2Pix EVM contracts to be imported by the project.

Usage

Pre Requisites

Before installing, create a .env file and set a BIP-39 compatible mnemonic and other env criteria as in .env.example.

Install

$ yarn install

Compile

$ yarn compile

NOTE: TypeChain artifacts generated at compile time.

Test

$ yarn test

Report Gas

$ REPORT_GAS=true yarn test

NOTE: Gas usage per unit test and average gas per method call.

Clean

Delete the smart contract artifacts and cache:

$ yarn clean

Importing artifacts

To import artifacts on the project use the following:

import P2PIXArtifact from 'p2pix-smart-contracts/artifacts/contracts/p2pix.sol/P2PIX.json'

To grab deployment addresses you can just grab from deploys folder:

import localhostDeploys from 'p2pix-smart-contracts/deploys/localhost.json'

Deploying to local environment

On the first teminal, use the following command and import some wallets to your Metamask, then connect to the network pointed:

yarn hardhat node

On the second teminal, run the following commands:

yarn deploy1:localhost
yarn deploy2:localhost

NOTE: The second script transfers 2M tokens to the first wallet of the node. To use the P2Pix smart contract first transfer some of the tokens to other wallets.