Contracts & Integration
All contracts are deployed on Polkadot Asset Hub Testnet (Chain ID 420420417). EVM contracts are compatible with standard ethers.js and viem tooling. The ink! Wasm and PVM contracts are invoked internally by the backend service layer.
https://eth-rpc-testnet.polkadot.io/ · Explorer: blockscout-testnet.polkadot.ioEVM Contracts
| Contract | Address | Description |
|---|---|---|
| KredioLending | 0x61c6b46f5094f2867Dce66497391d0fd41796CEa | mUSDC lending pool with credit-scored borrowing and yield routing |
| KredioPASMarket | 0x5617dBa1b13155fD6fD62f82ef6D9e8F0F3B0E86 | Native PAS collateral market; oracle-priced LTV and liquidation |
| KredioSwap | 0xaF1d183F4550500Beb517A3249780290A88E6e39 | Oracle-priced PAS → mUSDC swap with slippage guard |
| KredioXCMSettler | 0xE0C102eCe5F6940D5CAF77B6980456F188974e52 | XCM intent settlement engine; decodes and executes parachain Transact payloads |
| KredioAccountRegistry | 0xe3603f70ACeBe6A7f3975cf3Edbd12EfeA78aDeA | SR25519 Substrate key ↔ EVM address binding with on-chain verification |
| GovernanceCache | 0xe4DE7eadE2c0A65BdA6863Ad7bA22416c77F3e55 | On-chain OpenGov vote count and conviction cache (Phase 4 credit input) |
| PASOracle | 0x1494432a8Af6fa8c03C0d7DD7720E298D85C55c7 | Chainlink AggregatorV3-compatible PAS/USD price feed |
| mUSDC | 0x5998cE005b4f3923c988Ae31940fAa1DEAC0c646 | Protocol stablecoin; 6 decimals; public testnet faucet via mint() |
| YieldPool | 0x12CEF08cb9D58357A170ee2fA70b3cE2c0419bd6 | External yield destination for idle lending capital |
| KredioBridgeMinter | configured via MINTER_ADDR env | Hub-side ETH → mUSDC bridge minter; replay-protected by source tx hash |
| EthBridgeInbox (Sepolia) | configured via INBOX_ADDR env | Source-chain ETH deposit contract; emits EthDeposited trigger event |
ink! Contracts
KreditAgent
ink! Wasm0x8c13E6fFDf27bB51304Efff108C9B646d148E5F3
Deterministic credit scorer; invoked atomically via SCALE staticcall from EVM markets
NeuralScorer
ink! PVM0xac6bd3ff3447d8d1689dd4f02899ff558f108e0d
Neural cross-validation; emits ScoreInferred with confidence delta
RiskAssessor
ink! PVM0xdB9E48932E061D95E22370235ac3a35332d289f7
Forward-looking liquidation risk; emits RiskAssessed with blocks-to-liq
YieldMind
ink! PVM0x0b68fbfb596846e4f3a23da10365e0888a182ef3
Optimal capital allocation across yield buckets; emits AllocationComputed
Build from Source
Prerequisites
- Foundry (
forge,cast) -curl -L https://foundry.paradigm.xyz | bash && foundryup - Rust +
cargo-contract-rustup target add wasm32-unknown-unknown && cargo install cargo-contract - Node.js ≥ 18 (for deployment scripts)
EVM Contracts
cd contracts
forge install # install lib/ dependencies
forge build # compile all Solidity contracts
forge test # run full test suite
forge test -vvv # with traces and logsKreditAgent (ink! Wasm)
cd contracts/kredit_agent
cargo contract build --release
# Output: target/ink/kredit_agent.contractPVM ink! Contracts
cargo contract build --release --manifest-path contracts/pvm/neural_scorer/Cargo.toml
cargo contract build --release --manifest-path contracts/pvm/risk_assessor/Cargo.toml
cargo contract build --release --manifest-path contracts/pvm/yield_mind/Cargo.tomlDeploy
Create contracts/.env:
ADMIN=<private_key_hex> # no 0x prefix
PASET_RPC=https://eth-rpc-testnet.polkadot.io/
SEPOLIA_RPC=https://rpc.sepolia.org# Core protocol (Asset Hub)
cd contracts && source .env
forge script script/Deploy.s.sol --rpc-url $PASET_RPC --broadcast --private-key $ADMIN -vvv
# Bridge contracts
forge script script/DeployBridge.s.sol:DeployInbox --rpc-url $SEPOLIA_RPC --chain-id 11155111 --private-key $ADMIN --broadcast
forge script script/DeployBridge.s.sol:DeployMinter --rpc-url $PASET_RPC --chain-id 420420417 --private-key $ADMIN --broadcastAfter deployment, update contract addresses in backend/.env and frontend/config/contracts.ts.
Frontend Integration
All contract ABIs are available in frontend/lib/constants.ts and addresses are centralised in frontend/config/contracts.ts, keyed by Chain ID. The useProtocolData and useProtocolActions hooks cover the full set of read and write operations for all user-facing contracts.
// Read all protocol state in a single batched RPC call
const {
creditScore, creditTier, collateralRatio, interestRate,
healthRatio, lendingPosition, borrowPosition,
pasPrice, protocolTotals,
} = useProtocolData()
// Execute any protocol action
const { deposit, borrow, repay, liquidate, swap } = useProtocolActions()