A blockchain-based platform that enables exporters to get short-term loans against shipping invoices, with investors funding curated pools of invoices for returns.
This platform connects exporters, investors, and admins through smart contracts to facilitate secure and transparent shipping invoice financing. The system uses NFTs to represent both individual invoices and pools of curated invoices.
- Invoice NFTs: Individual shipping invoices represented as ERC-721 tokens
- Pool NFTs: Curated bundles of invoices for investment
- 70% Funding Threshold: Exporters can withdraw when invoices reach 70% funding
- Profit Sharing: 4% yield for investors + 1% platform fee
- Role-based Access: Admin, Exporter, and Investor roles
- Node.js: v18.0.0 or higher
- Git: Latest version
- Foundry: Ethereum development toolkit
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup# Clone the repository
git clone https://github.com/SEATrax/smart-contract.git
cd smart-contract
# Initialize dependencies (IMPORTANT!)
git submodule update --init --recursive
# Alternative: use forge install
forge install
# Verify setup
forge buildCreate a .env file in the root directory:
# Lisk Sepolia Testnet Configuration
LISK_SEPOLIA_RPC_URL=https://rpc.sepolia-api.lisk.com
LISK_SEPOLIA_CHAIN_ID=4202
LISK_SEPOLIA_EXPLORER=https://sepolia-blockscout.lisk.com
# Deployment
PRIVATE_KEY=your_private_key_here
ADMIN_ADDRESS=your_admin_addressforge buildforge test
# Run with verbose output
forge test -vvv
# Run specific test
forge test --match-test testInvoiceCreationforge fmtforge snapshot# Start local blockchain
anvil
# Deploy locally (in another terminal)
forge script script/Deploy.s.sol:DeployScript --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcastDeploy to Lisk Sepolia Testnet:
# Basic deployment
forge script script/Deploy.s.sol:DeployScript \
--rpc-url $LISK_SEPOLIA_RPC_URL \
--private-key $PRIVATE_KEY \
--broadcast
# With contract verification
forge script script/Deploy.s.sol:DeployScript \
--rpc-url $LISK_SEPOLIA_RPC_URL \
--private-key $PRIVATE_KEY \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url $LISK_SEPOLIA_EXPLORER/api- Network Name: Lisk Sepolia Testnet
- Chain ID: 4202
- RPC URL: https://rpc.sepolia-api.lisk.com
- Currency: ETH
- Explorer: https://sepolia-blockscout.lisk.com
├── src/ # Smart contracts
│ ├── AccessControl.sol # Role-based access control
│ ├── InvoiceNFT.sol # Individual invoice NFTs
│ ├── PoolNFT.sol # Pool of invoices NFTs
│ ├── PoolFundingManager.sol # Investment and funding logic
│ └── PaymentOracle.sol # Payment confirmation system
├── test/ # Test files
├── script/ # Deployment scripts
│ └── Deploy.s.sol
├── .github/ # Project documentation
│ ├── implementation-checklist.md
│ └── copilot-instruction-overview-project.md
└── foundry.toml # Foundry configuration
Build fails with missing dependencies:
git submodule update --init --recursive
forge installTest failures:
forge clean
forge build
forge testDeployment fails:
- Check your
.envfile configuration - Ensure you have sufficient ETH on Lisk Sepolia
- Verify network connectivity
- Follow the implementation phases in
.github/implementation-checklist.md - Ensure all tests pass:
forge test - Check code formatting:
forge fmt - Verify contracts build:
forge build
forge --help
anvil --help
cast --help