Skip to content

NEDA-LABS/stablenode-contracts

Repository files navigation

solidity v0.8.20

NEDAPay Stablenode Contracts

Description

NEDAPay Stablenode contracts are multi-chain EVM-based smart contracts that facilitate the on-chain lifecycle of payment orders. They empower senders to create payment orders, enable liquidity providers to receive cryptocurrency in escrow, and provide a secure, transparent payment infrastructure for cross-border transactions.

image

Deployment

Deployment is done using Hardhat scripts

Deploy and verify upgradeable proxy contract

# Deploy with secure ownership
npx hardhat run scripts/deploySecure.ts --network <network>

# Verify implementation contract
npx hardhat verify --network <network> <implementation_address>

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

Check contract settings

Verify current contract configuration including aggregator, treasury, supported tokens, and fees:

# Check all contract settings
npx hardhat run scripts/checkContractSettings.ts --network <network>

# Example: Check Base Sepolia settings
npx hardhat run scripts/checkContractSettings.ts --network baseSepolia

Owner configurations

Update network settings in scripts/config.ts

# Verify and set all supported tokens (recommended)
npx hardhat run scripts/verifyAndSetTokens.ts --network <network>

# Set supported tokens (legacy)
npx hardhat run scripts/setSupportedTokens.ts --network <network>

# Update aggregator address only
npx hardhat run scripts/updateAggregator.ts --network <network>

# Update protocol addresses (treasury and aggregator)
npx hardhat run scripts/updateProtocolAddresses.ts --network <network>

# Update protocol fee
npx hardhat run scripts/updateProtocolFee.ts --network <network>

Note: The verifyAndSetTokens.ts script provides comprehensive verification before setting tokens, including:

  • Contract address validation
  • Owner verification
  • Current token support status check
  • Confirmation prompt before execution
  • Post-execution verification

Testnet Contracts

Network Contracts Address Explorer
Base Sepolia Gateway Proxy 0x327698AB6321de487F0321a2C5CA9Bec3d2bB47E View
Gateway Implementation 0xD4970b4003DFf84BCedBD5Ce5c796d226656860a View
Gateway Admin 0x7f18A3719Ad0CD59C48A8dBC0C57Dd7eCa07A0Dd View

Mainnet Contracts

Network Contracts Address Explorer
Base Gateway Proxy 0x40D8161F6E9D1A6385C90008082cBc97f5C7D098 View
Gateway Implementation 0x186E2D89099Ef4D3a2C670aB50B5B851d0c57ce8 View
Gateway Admin 0xEf2B9dbdBb0195e235f9DEfAce126188d692714c View

Testing

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

npx hardhat test

Our team will review your pull request and work with you to get it merged into the main branch of the repository.

If you encounter any issues or have questions, feel free to open an issue on the repository.

Contributors ✨

Contributions of any kind are welcome!

License

Affero General Public License v3.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5