Skip to content

Latest commit

 

History

History
305 lines (265 loc) · 8.15 KB

README.md

File metadata and controls

305 lines (265 loc) · 8.15 KB

solidity v0.8.18

Paycrest Contracts

Description

Paycrest contracts are multi-chain EVM-based smart contracts that facilitate the on-chain lifecycle of a payment order. They empower a sender to create a payment order, enable a liquidity provider to receive cryptocurrency in escrow, and much more.

Deployment

Deployment is done using Hardhat scripts

Deploy and verify upgradeable proxy contract

npx hardhat run scripts/deploy.ts --network <network>

npx hardhat verify --network <network> <contract_address>

# for Tron network,
tronbox migrate -f 1 --to 1 --network <network>

Upgrade proxy contract

npx hardhat run scripts/upgrade.ts --network <network>

# upgrade across all EVM chains
npx hardhat run scripts/upgrade.ts --network arbitrumOne && npx hardhat run scripts/upgrade.ts --network base && npx hardhat run scripts/upgrade.ts --network bsc && npx hardhat run scripts/upgrade.ts --network polygon && npx hardhat run scripts/upgrade.ts --network optimisticEthereum && npx hardhat run scripts/upgrade.ts --network scroll

# upgrade across all EVM testnet chains
npx hardhat run scripts/upgrade.ts --network arbitrumSepolia && npx hardhat run scripts/upgrade.ts --network amoy && npx hardhat run scripts/upgrade.ts --network baseSepolia && npx hardhat run scripts/upgrade.ts --network sepolia

# for Tron network,
tronbox migrate -f 2 --to 2 --network <network>

Owner configurations

Update network settings in scripts/config.ts

npx hardhat run scripts/setSupportedTokens.ts --network <network>

npx hardhat run scripts/updateProtocolAddresses.ts --network <network>

npx hardhat run scripts/updateProtocolFee.ts --network <network>

# for Tron network,
npx hardhat run scripts/tron/setSupportedTokens.ts

npx hardhat run scripts/tron/updateProtocolAddresses.ts

npx hardhat run scripts/tron/updateProtocolFee.ts

Testnet Contracts

Network Contracts Address
Ethereum Sepolia Gateway Proxy 0xCAD53Ff499155Cc2fAA2082A85716322906886c2
Gateway Implementation 0xafbf71A72d30f81eb66baaF904ea537fD35dd106
Polygon Amoy Gateway Proxy 0xCAD53Ff499155Cc2fAA2082A85716322906886c2
Gateway Implementation 0xd2d97002ec87ba57fcf3f6b510f20d5a80a6c33a
Arbitrum Sepolia Gateway Proxy 0x87B321fc77A0fDD0ca1fEe7Ab791131157B9841A
Gateway Implementation 0xd2d97002Ec87ba57FCf3f6b510f20d5A80A6C33a
Base Sepolia Gateway Proxy 0x847dfdAa218F9137229CF8424378871A1DA8f625
Gateway Implementation 0xd2d97002Ec87ba57FCf3f6b510f20d5A80A6C33a
Tron Shasta Gateway Proxy TYA8urq7nkN2yU7rJqAgwDShCusDZrrsxZ
Gateway Implementation TSGr6Ri7NZ7FxN1gCiWkn8cPA2qtF6ctdF
Gateway Admin TNcogTDoWxpuv77WtsiNTRhqjRbZmmDLTR

Mainnet Contracts

Network Contracts Address
Ethereum Gateway Proxy 0x16c9C78Dbb224889E3e2ADef991C8c4438ea797B
Gateway Implementation 0xD293fCd3dBc025603911853d893A4724CF9f70a0
Polygon Gateway Proxy 0xfB411Cc6385Af50A562aFCb441864E9d541CDA67
Gateway Implementation 0xd2d97002ec87ba57fcf3f6b510f20d5a80a6c33a
Base Gateway Proxy 0x30F6A8457F8E42371E204a9c103f2Bd42341dD0F
Gateway Implementation 0xd2d97002ec87ba57fcf3f6b510f20d5a80a6c33a
BNB Smart Chain Gateway Proxy 0x1FA0EE7F9410F6fa49B7AD5Da72Cf01647090028
Gateway Implementation 0xd2d97002ec87ba57fcf3f6b510f20d5a80a6c33a
Arbitrum One Gateway Proxy 0xE8bc3B607CfE68F47000E3d200310D49041148Fc
Gateway Implementation 0x8fd1f78d88dd008e557273b5cd517487c2a9a7de
Optimism Ethereum Gateway Proxy 0xD293fCd3dBc025603911853d893A4724CF9f70a0
Gateway Implementation 0xd2d97002Ec87ba57FCf3f6b510f20d5A80A6C33a
Gateway Admin 0xb9B5280AB99E48a9662D4740B1e1398abdf87b6D
Scroll Gateway Proxy 0x663C5BfE7d44bA946C2dd4b2D1Cf9580319F9338
Gateway Implementation 0xd2d97002ec87ba57fcf3f6b510f20d5a80a6c33a
Gateway Admin 0x16c9C78Dbb224889E3e2ADef991C8c4438ea797B
Tron Gateway Proxy THyFP5ST9YyLZn6EzjKjFhZti6aKPgEXNU
Gateway Implementation TDhBvHbnF8nN7YctokpdZAVPcmBx2Jrn2d
Gateway Admin TLw6AW9khfwLVq5gq9uV71wTVZEPxKjoiZ

Testing

Contract tests are defined under the tests directory. To run all the tests, run:

npx hardhat test

Commits and PRs

This project uses Conventional Commits to generate release notes and to determine versioning. Commit messages should adhere to this standard and be of the form:

$ git commit -m "feat: Add new feature x"
$ git commit -m "fix: Fix bug in feature x"
$ git commit -m "docs: Add documentation for feature x"
$ git commit -m "test: Add test suite for feature x"

Further details on conventional commits can be found here

Contributors ✨

Prosperity
Prosperity

💻
chibie
chibie

💻
Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!

License

Affero General Public License v3.0