Repository for P2Pix EVM contracts to be imported by the project.
Go to file
hueso c25fa24b2f ditch amount hardcodings 2024-03-03 21:53:48 -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
contracts set deposit() nonReentrant 2024-02-29 20:09:54 -03:00
deploys add RSK networks 2024-02-13 13:26:39 -03:00
docs update documentation 2024-02-13 16:35:16 -03:00
scripts add RSK networks 2024-02-13 13:26:39 -03:00
test ditch amount hardcodings 2024-03-03 21:53:48 -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 V2 Release 2023-01-26 21:40:17 -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 add artifacts to .gitignore 2023-09-04 18:02:33 -03:00
.lintstagedrc refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.prettierignore Enhanced integration & optimized testing 2023-02-14 18:40:02 -03:00
.prettierrc.yaml refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
.solcover.js Moved stack allocation from memory to calldata 2023-05-22 06:40: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 🏗️ 2023-05-16 21:09:39 -03:00
hardhat.config.ts update documentation 2024-02-13 16:35:16 -03:00
package.json update documentation 2024-02-13 16:35:16 -03:00
tsconfig.json refactor: typescript refactoring ♻️ 2022-11-14 09:34:53 -03:00
yarn.lock Types cleanup 2023-05-19 00:49:29 -03:00

README.md

p2pix-smart-contracts

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

SM Dependency Tree

./contracts/
├── Constants.sol
├── DataTypes.sol
├── EventAndErrors.sol
├── lib
   ├── auth
      └── Owned.sol
   ├── interfaces
      └── IReputation.sol
   ├── mock
      └── mockToken.sol
   ├── tokens
      └── ERC20.sol
   └── utils
       ├── ECDSA.sol
       ├── MerkleProofLib.sol
       ├── Multicall.sol
       ├── ReentrancyGuard.sol
       └── SafeTransferLib.sol
├── p2pix.sol
└── Reputation.sol

Callgraph

Callgraph

Current Deployment addresses

V1

Testnet Token Address P2pix Address
Goerli 0x294003F602c321627152c6b7DED3EAb5bEa853Ee 0x5f3EFA9A90532914545CEf527C530658af87e196
Mumbai 0x294003F602c321627152c6b7DED3EAb5bEa853Ee 0x5f3EFA9A90532914545CEf527C530658af87e196

V2

Testnet Token Address P2pix Address Reputation Address Multicall Address
Goerli 0x4A2886EAEc931e04297ed336Cc55c4eb7C75BA00 0x2414817FF64A114d91eCFA16a834d3fCf69103d4 0x2CFD9354Ec7614fEf036EFd6A730dA1d5fC2762A 0x8FE009992d96A86c7f0Bccdaf1eC3471E302a8a6
Mumbai 0xC86042E9F2977C62Da8c9dDF7F9c40fde4796A29 0x4A2886EAEc931e04297ed336Cc55c4eb7C75BA00 0x570445E3eF413bCDb5De79ed27B1c3840683e385 0x718B2C4DE4F9654E1349F610ff561249bfe1c418

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.

Deploying to testnets

Deploy to Ethereum's Goerli testnet:

yarn deploy1:goerli
yarn deploy2:goerli

Deploy to Polygon's Mumbai testnet:

yarn deploy1:mumbai
yarn deploy2:mumbai