Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Aggregator C... | 11034079 | 4 days ago | IN | 0 S | 0.0024049 |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x4ab6044f...Be9265466 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DebitaIncentives
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract DebitaIncentives { event Incentivized( address indexed principle, address indexed incentivizeToken, uint amount, bool lendIncentivize, uint epoch ); event ClaimedIncentives( address indexed user, address indexed principle, address indexed incentivizeToken, uint amount, uint epoch ); event UpdatedFunds( address indexed lenders, address indexed principle, address indexed collateral, address borrower, uint epoch ); event WhitelistedPair( address indexed principle, address indexed collateral, bool whitelisted ); uint public blockDeployedContract; // timestamp of deployment uint public epochDuration = 14 days; // duration of an epoch address owner; address aggregatorContract; struct infoOfOffers { address principle; // address of the principle address lendOffer; // address of the lend offer uint principleAmount; // amount of principle uint lenderID; // ID of the lender uint apr; // APR of the offer uint ratio; // ratio of the offer uint collateralUsed; // collateral used uint maxDeadline; // max deadline bool paid; // has been paid bool collateralClaimed; // has collateral been claimed bool debtClaimed; // total debt claimed uint interestToClaim; // available interest to claim uint interestPaid; // interest already paid } struct InfoOfBribePerPrinciple { address principle; // address of the principle address[] bribeToken; // address of the bribe tokens uint[] amountPerLent; uint[] amountPerBorrow; uint epoch; } /* ------- Lend Incentives ------- */ // principle => (keccack256(bribe token, epoch)) => total incentives amount mapping(address => mapping(bytes32 => uint)) public lentIncentivesPerTokenPerEpoch; // wallet address => keccack256(principle + epoch) => amount lent mapping(address => mapping(bytes32 => uint)) public lentAmountPerUserPerEpoch; /* -------- Borrow Incentives -------- */ // principle => keccack(bribe token, epoch) => amount per Token mapping(address => mapping(bytes32 => uint)) public borrowedIncentivesPerTokenPerEpoch; // wallet address => keccack256(principle + epoch) => amount mapping(address => mapping(bytes32 => uint)) public borrowAmountPerEpoch; // principle => epoch => total lent amount mapping(address => mapping(uint => uint)) public totalUsedTokenPerEpoch; // wallet => keccack256(principle + epoch + bribe token) => amount claimed mapping(address => mapping(bytes32 => bool)) public claimedIncentives; /* Security check */ // principle => collateral => is whitelisted mapping(address => mapping(address => bool)) public isPairWhitelisted; mapping(address => bool) public isPrincipleWhitelisted; /* MAPPINGS FOR READ FUNCTIONS */ // epoch uint => index => principle address mapping(uint => mapping(uint => address)) public epochIndexToPrinciple; // epoch uint => amount of principles incentivized mapping(uint => uint) public principlesIncentivizedPerEpoch; // epoch uint => principle address => has been indexed mapping(uint => mapping(address => bool)) public hasBeenIndexed; // epoch => keccak(principle address, index) => bribeToken mapping(uint => mapping(bytes32 => address)) public SpecificBribePerPrincipleOnEpoch; // epoch => principle => amount of bribe Tokens mapping(uint => mapping(address => uint)) public bribeCountPerPrincipleOnEpoch; // epoch => incentive token => bool has been indexed mapping(uint => mapping(address => bool)) public hasBeenIndexedBribe; modifier onlyAggregator() { require(msg.sender == aggregatorContract, "Only aggregator"); _; } constructor() { owner = msg.sender; blockDeployedContract = block.timestamp; } /** * @dev Claim the incentives for the user * @param principles array of principles used during the epoch * @param tokensIncentives array of tokens to claim per principle * @param epoch epoch to claim */ function claimIncentives( address[] memory principles, address[][] memory tokensIncentives, uint epoch ) public { // get information require(epoch < currentEpoch(), "Epoch not finished"); for (uint i; i < principles.length; i++) { address principle = principles[i]; uint lentAmount = lentAmountPerUserPerEpoch[msg.sender][ hashVariables(principle, epoch) ]; // get the total lent amount for the epoch and principle uint totalLentAmount = totalUsedTokenPerEpoch[principle][epoch]; uint porcentageLent; if (lentAmount > 0) { porcentageLent = (lentAmount * 1e18) / totalLentAmount; } uint borrowAmount = borrowAmountPerEpoch[msg.sender][ hashVariables(principle, epoch) ]; uint totalBorrowAmount = totalUsedTokenPerEpoch[principle][epoch]; uint porcentageBorrow; require( borrowAmount > 0 || lentAmount > 0, "No borrowed or lent amount" ); porcentageBorrow = (borrowAmount * 1e18) / totalBorrowAmount; for (uint j = 0; j < tokensIncentives[i].length; j++) { address token = tokensIncentives[i][j]; uint lentIncentive = lentIncentivesPerTokenPerEpoch[principle][ hashVariables(token, epoch) ]; uint borrowIncentive = borrowedIncentivesPerTokenPerEpoch[ principle ][hashVariables(token, epoch)]; require( !claimedIncentives[msg.sender][ hashVariablesT(principle, epoch, token) ], "Already claimed" ); require( (lentIncentive > 0 && lentAmount > 0) || (borrowIncentive > 0 && borrowAmount > 0), "No incentives to claim" ); claimedIncentives[msg.sender][ hashVariablesT(principle, epoch, token) ] = true; uint amountToClaim = (lentIncentive * porcentageLent) / 1e18; amountToClaim += (borrowIncentive * porcentageBorrow) / 1e18; IERC20(token).transfer(msg.sender, amountToClaim); emit ClaimedIncentives( msg.sender, principle, token, amountToClaim, epoch ); } } } /** * @dev Incentivize the pair --> anyone can incentivze the pair but it's mainly thought for chain incentives or points system * @param principles array of principles to incentivize * @param incentiveToken array of tokens you want to give as incentives * @param lendIncentivize array of bools to know if you want to incentivize the lend or the borrow * @param amounts array of amounts to incentivize * @param epochs array of epochs to incentivize */ function incentivizePair( address[] memory principles, address[] memory incentiveToken, bool[] memory lendIncentivize, uint[] memory amounts, uint[] memory epochs ) public { require( principles.length == incentiveToken.length && incentiveToken.length == lendIncentivize.length && lendIncentivize.length == amounts.length && amounts.length == epochs.length, "Invalid input" ); for (uint i; i < principles.length; i++) { uint epoch = epochs[i]; address principle = principles[i]; address incentivizeToken = incentiveToken[i]; uint amount = amounts[i]; require(epoch > currentEpoch(), "Epoch already started"); require(isPrincipleWhitelisted[principle], "Not whitelisted"); // if principles has been indexed into array of the epoch if (!hasBeenIndexed[epochs[i]][principles[i]]) { uint lastAmount = principlesIncentivizedPerEpoch[epochs[i]]; epochIndexToPrinciple[epochs[i]][lastAmount] = principles[i]; principlesIncentivizedPerEpoch[epochs[i]]++; hasBeenIndexed[epochs[i]][principles[i]] = true; } // if bribe token has been indexed into array of the epoch if (!hasBeenIndexedBribe[epoch][incentivizeToken]) { uint lastAmount = bribeCountPerPrincipleOnEpoch[epoch][ principle ]; SpecificBribePerPrincipleOnEpoch[epoch][ hashVariables(principle, lastAmount) ] = incentivizeToken; bribeCountPerPrincipleOnEpoch[epoch][incentivizeToken]++; hasBeenIndexedBribe[epoch][incentivizeToken] = true; } // transfer the tokens IERC20(incentivizeToken).transferFrom( msg.sender, address(this), amount ); require(amount > 0, "Amount must be greater than 0"); // add the amount to the total amount of incentives if (lendIncentivize[i]) { lentIncentivesPerTokenPerEpoch[principle][ hashVariables(incentivizeToken, epoch) ] += amount; } else { borrowedIncentivesPerTokenPerEpoch[principle][ hashVariables(incentivizeToken, epoch) ] += amount; } emit Incentivized( principles[i], incentiveToken[i], amounts[i], lendIncentivize[i], epochs[i] ); } } // Update the funds of the user and the total amount of the principle // -- only aggregator whenever a loan is matched /** * @dev Update the funds of the user and the total amount of the principle * @param informationOffers array of information of the offers * @param collateral address of the collateral * @param lenders array of lenders * @param borrower address of the borrower */ function updateFunds( infoOfOffers[] memory informationOffers, address collateral, address[] memory lenders, address borrower ) public onlyAggregator { for (uint i = 0; i < lenders.length; i++) { bool validPair = isPairWhitelisted[informationOffers[i].principle][ collateral ]; if (!validPair) { continue; } address principle = informationOffers[i].principle; uint _currentEpoch = currentEpoch(); lentAmountPerUserPerEpoch[lenders[i]][ hashVariables(principle, _currentEpoch) ] += informationOffers[i].principleAmount; totalUsedTokenPerEpoch[principle][ _currentEpoch ] += informationOffers[i].principleAmount; borrowAmountPerEpoch[borrower][ hashVariables(principle, _currentEpoch) ] += informationOffers[i].principleAmount; emit UpdatedFunds( lenders[i], principle, collateral, borrower, _currentEpoch ); } } // Get the amount of principles incentivized and the amount of bribes per principle function getBribesPerEpoch( uint epoch, uint offset, uint limit ) public view returns (InfoOfBribePerPrinciple[] memory) { // get the amount of principles incentivized uint totalPrinciples = principlesIncentivizedPerEpoch[epoch]; if (totalPrinciples == 0) { return new InfoOfBribePerPrinciple[](0); } if (offset > totalPrinciples) { return new InfoOfBribePerPrinciple[](0); } if (limit > totalPrinciples) { limit = totalPrinciples; } uint length = limit - offset; InfoOfBribePerPrinciple[] memory bribes = new InfoOfBribePerPrinciple[]( length ); for (uint i = 0; i < length; i++) { address principle = epochIndexToPrinciple[epoch][i + offset]; uint totalBribes = bribeCountPerPrincipleOnEpoch[epoch][principle]; address[] memory bribeToken = new address[](totalBribes); uint[] memory amountPerLent = new uint[](totalBribes); uint[] memory amountPerBorrow = new uint[](totalBribes); for (uint j = 0; j < totalBribes; j++) { address token = SpecificBribePerPrincipleOnEpoch[epoch][ hashVariables(principle, j) ]; uint lentIncentive = lentIncentivesPerTokenPerEpoch[principle][ hashVariables(token, epoch) ]; uint borrowIncentive = borrowedIncentivesPerTokenPerEpoch[ principle ][hashVariables(token, epoch)]; bribeToken[j] = token; amountPerLent[j] = lentIncentive; amountPerBorrow[j] = borrowIncentive; } bribes[i] = InfoOfBribePerPrinciple( principle, bribeToken, amountPerLent, amountPerBorrow, epoch ); } return bribes; } function setAggregatorContract(address _aggregatorContract) public { require(msg.sender == owner, "Only owner"); require(aggregatorContract == address(0), "Already set"); aggregatorContract = _aggregatorContract; } function whitelListCollateral( address _principle, address _collateral, bool whitelist ) public { require(msg.sender == owner, "Only owner"); if (isPrincipleWhitelisted[_principle] == false && whitelist) { isPrincipleWhitelisted[_principle] = whitelist; } isPairWhitelisted[_principle][_collateral] = whitelist; emit WhitelistedPair(_principle, _collateral, whitelist); } function deprecatePrinciple(address _principle) public { require(msg.sender == owner, "Only owner"); isPrincipleWhitelisted[_principle] = false; } function hashVariables( address _principle, uint _epoch ) public pure returns (bytes32) { return keccak256(abi.encodePacked(_principle, _epoch)); } function hashVariablesT( address _principle, uint _epoch, address _tokenToClaim ) public pure returns (bytes32) { return keccak256(abi.encodePacked(_principle, _epoch, _tokenToClaim)); } function currentEpoch() public view returns (uint) { return ((block.timestamp - blockDeployedContract) / epochDuration) + 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
{ "remappings": [ "@pythnetwork/pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@contracts/=contracts/", "@aerodrome/=lib/contracts/contracts/", "forge-std/=lib/forge-std/src/", "@redstone-finance/evm-connector/dist/contracts/=lib/redstone-oracles-monorepo/packages/evm-connector/contracts/", "@chainlink/=lib/foundry-chainlink-toolkit/", "@opengsn/=lib/contracts/lib/gsn/packages/", "@uniswap/v3-core/=lib/contracts/lib/v3-core/", "chainlink-brownie-contracts/=lib/foundry-chainlink-toolkit/lib/chainlink-brownie-contracts/contracts/src/v0.6/vendor/@arbitrum/nitro-contracts/src/", "contracts/=lib/contracts/contracts/", "ds-test/=lib/contracts/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "foundry-chainlink-toolkit/=lib/foundry-chainlink-toolkit/", "gsn/=lib/contracts/lib/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "redstone-oracles-monorepo/=lib/redstone-oracles-monorepo/", "utils/=lib/contracts/test/utils/", "v3-core/=lib/contracts/lib/v3-core/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"principle","type":"address"},{"indexed":true,"internalType":"address","name":"incentivizeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"ClaimedIncentives","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"principle","type":"address"},{"indexed":true,"internalType":"address","name":"incentivizeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"lendIncentivize","type":"bool"},{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"Incentivized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lenders","type":"address"},{"indexed":true,"internalType":"address","name":"principle","type":"address"},{"indexed":true,"internalType":"address","name":"collateral","type":"address"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"UpdatedFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"principle","type":"address"},{"indexed":true,"internalType":"address","name":"collateral","type":"address"},{"indexed":false,"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"WhitelistedPair","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"SpecificBribePerPrincipleOnEpoch","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockDeployedContract","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"borrowAmountPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"borrowedIncentivesPerTokenPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"bribeCountPerPrincipleOnEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"principles","type":"address[]"},{"internalType":"address[][]","name":"tokensIncentives","type":"address[][]"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"claimIncentives","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"claimedIncentives","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_principle","type":"address"}],"name":"deprecatePrinciple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epochDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochIndexToPrinciple","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getBribesPerEpoch","outputs":[{"components":[{"internalType":"address","name":"principle","type":"address"},{"internalType":"address[]","name":"bribeToken","type":"address[]"},{"internalType":"uint256[]","name":"amountPerLent","type":"uint256[]"},{"internalType":"uint256[]","name":"amountPerBorrow","type":"uint256[]"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"internalType":"struct DebitaIncentives.InfoOfBribePerPrinciple[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"hasBeenIndexed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"hasBeenIndexedBribe","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_principle","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"hashVariables","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_principle","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"address","name":"_tokenToClaim","type":"address"}],"name":"hashVariablesT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address[]","name":"principles","type":"address[]"},{"internalType":"address[]","name":"incentiveToken","type":"address[]"},{"internalType":"bool[]","name":"lendIncentivize","type":"bool[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"epochs","type":"uint256[]"}],"name":"incentivizePair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isPairWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPrincipleWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"lentAmountPerUserPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"lentIncentivesPerTokenPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"principlesIncentivizedPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_aggregatorContract","type":"address"}],"name":"setAggregatorContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalUsedTokenPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"principle","type":"address"},{"internalType":"address","name":"lendOffer","type":"address"},{"internalType":"uint256","name":"principleAmount","type":"uint256"},{"internalType":"uint256","name":"lenderID","type":"uint256"},{"internalType":"uint256","name":"apr","type":"uint256"},{"internalType":"uint256","name":"ratio","type":"uint256"},{"internalType":"uint256","name":"collateralUsed","type":"uint256"},{"internalType":"uint256","name":"maxDeadline","type":"uint256"},{"internalType":"bool","name":"paid","type":"bool"},{"internalType":"bool","name":"collateralClaimed","type":"bool"},{"internalType":"bool","name":"debtClaimed","type":"bool"},{"internalType":"uint256","name":"interestToClaim","type":"uint256"},{"internalType":"uint256","name":"interestPaid","type":"uint256"}],"internalType":"struct DebitaIncentives.infoOfOffers[]","name":"informationOffers","type":"tuple[]"},{"internalType":"address","name":"collateral","type":"address"},{"internalType":"address[]","name":"lenders","type":"address[]"},{"internalType":"address","name":"borrower","type":"address"}],"name":"updateFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_principle","type":"address"},{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"bool","name":"whitelist","type":"bool"}],"name":"whitelListCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x6080806040526004361015610012575f80fd5b60e05f35811c918263018656d2146115da575081630a8c62b71461159c57816312d3c7c81461155f5781632f087f661461147d57816339e578f1146114395781633cde7e4a1461140f5781633df8d8b3146113e85781633f15d1e7146113a457816349808919146112975781634d6d0a1b1461124c5781634ff0876a1461122f57816354e85f90146111eb5781635fb0c8d6146111a757816369a9c17314610ce05781637667180814610cbe5781637842305b14610ca25781639967cf6014610c1e578163a579055514610be0578163b322abf914610ba3578163c2e83ed614610b5f578163c5924e9d14610b0d578163d038583f14610ac9578163d8987a4c14610a80578163d9d609951461073e57508063eb31fb0e146106f55763f35f14961461013c575f80fd5b346106d95760a03660031901126106d95767ffffffffffffffff6004358181116106d95761016e90369060040161170b565b906024358181116106d95761018790369060040161170b565b90604435918183116106d957366023840112156106d9578260040135926101ad846116f3565b936101bb60405195866116d1565b8085526024602086019160051b830101913683116106d957602401905b8282106106dd575050506064358281116106d9576101fa903690600401611771565b916084359081116106d957610213903690600401611771565b928451825180911490816106ce575b50806106c3575b806106b8575b15610683575f5b85518110156106815761024981866117dd565b51906001600160a01b0361025d82896117dd565b51166001600160a01b0361027183876117dd565b511661027d83886117dd565b5191610287611bb9565b85111561064457805f52600b60205260ff60405f2054161561060d576102ad848a6117dd565b515f908152600e602081905260409091206001600160a01b036102d0878e6117dd565b51165f5260205260ff60405f2054161561054c575b50845f5260118060205260405f20835f5260205260ff60405f205416156104be575b506040516323b872dd60e01b8152336004820152306024820152604481018490526020816064815f875af180156104b357610484575b50821561043f5761040a9461035285886117dd565b511561040f5761036d915f52600460205260405f2092611b27565b5f5260205261038160405f20918254611836565b90555b6001600160a01b0361039682896117dd565b51166001600160a01b036103aa83876117dd565b5116907f2647b01aa17f70a9b77804ddecbf76a9bb766b97a8917f25ec16d626b3c4e72e60606103da858a6117dd565b516103e586896117dd565b5115156103f2878d6117dd565b519060405192835260208301526040820152a36117cf565b610236565b610424915f52600660205260405f2092611b27565b5f5260205261043860405f20918254611836565b9055610384565b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b6104a59060203d6020116104ac575b61049d81836116d1565b810190611843565b505f61033d565b503d610493565b6040513d5f823e3d90fd5b855f5260108060205260405f20835f5260205260405f2054875f52600f6020526104ec60405f209185611b27565b5f5260205260405f20846001600160601b0360a01b825416179055865f5260205260405f20835f5260205260405f2061052581546117cf565b9055855f5260205260405f20825f5260205260405f20600160ff198254161790555f610307565b610556858b6117dd565b515f52600d806020528a8c6105848860405f20549261057c8260018060a01b03926117dd565b5116936117dd565b515f52600c60205260405f20905f5260205260405f20906001600160601b0360a01b8254161790556105b6868c6117dd565b515f5260205260405f206105ca81546117cf565b90556105d6858b6117dd565b515f5260205260405f2060018060a01b036105f1868d6117dd565b51165f5260205260405f20600160ff198254161790555f6102e5565b60405162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b6044820152606490fd5b60405162461bcd60e51b8152602060048201526015602482015274115c1bd8da08185b1c9958591e481cdd185c9d1959605a1b6044820152606490fd5b005b60405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606490fd5b50825184511461022f565b508051835114610229565b90508151145f610222565b5f80fd5b602080916106ea84611661565b8152019101906101d8565b346106d95760403660031901126106d95761070e611621565b6004355f52600e60205260405f209060018060a01b03165f52602052602060ff60405f2054166040519015158152f35b346106d957608090816003193601126106d95760043567ffffffffffffffff918282116106d957366023830112156106d957816004013561077e816116f3565b9261078c60405194856116d1565b81845260209283850190602497886101a0809602850101933685116106d9578901925b8484106109a1575050505050506107c4611621565b926044359081116106d9576107dd90369060040161170b565b6001600160a01b036064358181169691949092918784036106d9578560035416330361096c575093948516935f5b825181101561068157808761082361096293856117dd565b5151165f52600a865260405f20875f52865260ff60405f2054161561096757868861084e83866117dd565b515116610859611bb9565b604061086585886117dd565b5101518b610873868a6117dd565b51165f5260058a5260405f206108898385611b27565b5f528a5261089c60405f20918254611836565b905560406108aa85886117dd565b510151825f5260088a5260405f20825f528a526108cc60405f20918254611836565b905560406108da85886117dd565b5101518c5f5260078a5260405f206108f28385611b27565b5f528a5261090560405f20918254611836565b90557fcad033875b4c3b963442bcb485a7b1133b6322f35c78eb37c2624ebff51356b061095a8c610936878b6117dd565b51604080516001600160a01b038e1681526020810196909652911693918291820190565b0390a46117cf565b61080b565b6117cf565b84600f6064926040519262461bcd60e51b845260048401528201526e27b7363c9030b3b3b932b3b0ba37b960891b6044820152fd5b85843603126106d95760405190868201908282108b831117610a6d57879289926040526109cd8761164d565b81526109da83880161164d565b838201526040870135604082015260608088013590820152848701358582015260a0808801359082015260c080880135908201528587013586820152610100610a24818901611661565b90820152610120610a36818901611661565b90820152610140610a48818901611661565b90820152610160808801359082015261018080880135908201528152019301926107af565b8b634e487b7160e01b5f5260416004525ffd5b346106d95760403660031901126106d9576001600160a01b03610aa1611637565b165f52600960205260405f206024355f52602052602060ff60405f2054166040519015158152f35b346106d95760403660031901126106d957610ae2611621565b6004355f52601060205260405f209060018060a01b03165f52602052602060405f2054604051908152f35b346106d95760403660031901126106d957610b26611637565b610b2e611621565b9060018060a01b038091165f52600a60205260405f2091165f52602052602060ff60405f2054166040519015158152f35b346106d95760403660031901126106d9576001600160a01b03610b80611637565b165f52600660205260405f206024355f52602052602060405f2054604051908152f35b346106d95760203660031901126106d9576001600160a01b03610bc4611637565b165f52600b602052602060ff60405f2054166040519015158152f35b346106d95760403660031901126106d9576004355f52600c60205260405f206024355f52602052602060018060a01b0360405f205416604051908152f35b346106d95760203660031901126106d957610c37611637565b6002546001600160a01b0390610c509082163314611aee565b60035491818316610c6f576001600160a01b0319909216911617600355005b60405162461bcd60e51b815260206004820152600b60248201526a105b1c9958591e481cd95d60aa1b6044820152606490fd5b346106d9575f3660031901126106d95760205f54604051908152f35b346106d9575f3660031901126106d9576020610cd8611bb9565b604051908152f35b346106d95760603660031901126106d95767ffffffffffffffff6004358181116106d957610d1290369060040161170b565b602435918083116106d957366023840112156106d9578260040135610d36816116f3565b93610d4460405195866116d1565b8185526024602086019260051b820101913683116106d95760248201905b83821061117f578686610d73611bb9565b604435101561114557905f905b8251821015610681576001600160a01b03610d9b83856117dd565b511692335f52600560205260405f20610db660443586611b27565b5f5260205260405f2054845f526008908160205260405f206044355f5260205260405f2054935f918015958615611118575b5050335f52600760205260405f20610e0260443589611b27565b5f5260205260405f205492875f5260205260405f206044355f5260205260405f2054928015938480158096611110575b156110cb5782670de0b6b3a7640000810204670de0b6b3a76400001417156110b757670de0b6b3a7640000610e679202611818565b935f5b610e7488846117dd565b515181101561109e576001600160a01b03610e9982610e938b876117dd565b516117dd565b511690895f52600460205260405f20610eb460443584611b27565b5f5260205260405f20548a5f52600660205260405f20610ed660443585611b27565b5f5260205260405f2054335f5260096020528b610efb8560405f209260443590611b6a565b5f5260205260ff60405f205416611067578115158061105f575b801561104e575b1561101057670de0b6b3a7640000610f738a828f8b610f7a97610f6c92335f526009602052610f538c60405f209260443590611b6a565b5f5260205260405f20600160ff19825416179055611805565b0493611805565b0490611836565b60405163a9059cbb60e01b81523360048201526024810182905292906020846044815f865af19081156104b357610fec948d92610ff1575b5060405190815260443560208201527f228b27b5927d22ce7e6da37b97bed9b4d2c43b2f65b627149fb3753367e318b860403392a46117cf565b610e6a565b6110099060203d6020116104ac5761049d81836116d1565b508d610fb2565b60405162461bcd60e51b81526020600482015260166024820152754e6f20696e63656e746976657320746f20636c61696d60501b6044820152606490fd5b508015158015610f1c575087610f1c565b508915610f15565b60405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4818db185a5b5959608a1b6044820152606490fd5b50959350955050506110b091506117cf565b9091610d80565b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b815260206004820152601a60248201527f4e6f20626f72726f776564206f72206c656e7420616d6f756e740000000000006044820152606490fd5b508715610e32565b90919250670de0b6b3a7640000828181020481148717156110b75761113d9202611818565b908780610de8565b60405162461bcd60e51b8152602060048201526012602482015271115c1bd8da081b9bdd08199a5b9a5cda195960721b6044820152606490fd5b81358581116106d95760209161119c83926024369188010161170b565b815201910190610d62565b346106d95760403660031901126106d9576001600160a01b036111c8611637565b165f52600560205260405f206024355f52602052602060405f2054604051908152f35b346106d95760403660031901126106d9576001600160a01b0361120c611637565b165f52600860205260405f206024355f52602052602060405f2054604051908152f35b346106d9575f3660031901126106d9576020600154604051908152f35b346106d95760203660031901126106d957611265611637565b6002546001600160a01b03919061127f9083163314611aee565b165f908152600b60205260409020805460ff19169055005b346106d9576060806003193601126106d9576112ba6044356024356004356118bd565b90604051918291602080840190808552835180925260408501928160408460051b8801019501935f915b8483106112f15787870388f35b9193959092949650603f198882030183528487519160a080820160018060a01b0380865116845284860151928585015282518092528460c085019301915f915b818310611388575050505092829161136a61135a6001966040850151848203604086015261166e565b878401518382038985015261166e565b916080809101519101529801930193019092879695939492946112e4565b8351811685528b96948501949390930192600190920191611331565b346106d95760403660031901126106d9576001600160a01b036113c5611637565b165f52600760205260405f206024355f52602052602060405f2054604051908152f35b346106d95760403660031901126106d9576020610cd8611406611637565b60243590611b27565b346106d95760203660031901126106d9576004355f52600d602052602060405f2054604051908152f35b346106d95760403660031901126106d9576001600160a01b0361145a611637565b165f52600460205260405f206024355f52602052602060405f2054604051908152f35b346106d95760603660031901126106d957611496611637565b61149e611621565b90604435801515908181036106d9577f166ab56fe1c2653db7b0b26cba6d19d2cf00df94741c0db3f23d3620344c940d9161153360209260018060a01b0380966114ed82600254163314611aee565b1695865f52600b855260405f208260ff8254161580611558575b61153c575b5050600a855260405f20971696875f52845260405f209060ff801983541691151516179055565b604051908152a3005b611551919060ff801983541691151516179055565b888261150c565b5080611507565b346106d95760603660031901126106d957611578611637565b604435906001600160a01b03821682036106d957602091610cd89160243590611b6a565b346106d95760403660031901126106d9576004355f52600f60205260405f206024355f52602052602060018060a01b0360405f205416604051908152f35b346106d95760403660031901126106d9576020906115f6611621565b6004355f9081526011845260408082206001600160a01b039093168252918452205460ff1615158152f35b602435906001600160a01b03821682036106d957565b600435906001600160a01b03821682036106d957565b35906001600160a01b03821682036106d957565b359081151582036106d957565b9081518082526020808093019301915f5b82811061168d575050505090565b83518552938101939281019260010161167f565b60a0810190811067ffffffffffffffff8211176116bd57604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff8211176116bd57604052565b67ffffffffffffffff81116116bd5760051b60200190565b81601f820112156106d957803591611722836116f3565b9261173060405194856116d1565b808452602092838086019260051b8201019283116106d9578301905b82821061175a575050505090565b8380916117668461164d565b81520191019061174c565b81601f820112156106d957803591611788836116f3565b9261179660405194856116d1565b808452602092838086019260051b8201019283116106d9578301905b8282106117c0575050505090565b813581529083019083016117b2565b5f1981146110b75760010190565b80518210156117f15760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b818102929181159184041417156110b757565b8115611822570490565b634e487b7160e01b5f52601260045260245ffd5b919082018092116110b757565b908160209103126106d9575180151581036106d95790565b6040516020810181811067ffffffffffffffff8211176116bd576040525f815290565b919082039182116110b757565b90611895826116f3565b6118a260405191826116d1565b82815280926118b3601f19916116f3565b0190602036910137565b905f91808352602091600d8352604094858520548015611adc57808311611adc57818184926118f29411611ad4575b5061187e565b936118fc856116f3565b95611909815197886116d1565b858752601f19928361191a886116f3565b0186845b828110611aa257505050825b87811061193c57505050505050505090565b8390868252600c88528382206119528483611836565b8352885260018060a01b038085842054169088845260108a528584208285528a5285842054611980816116f3565b61198c885191826116d1565b81815289611999836116f3565b01368d8301376119a88261188b565b916119b28161188b565b93878d8f5b8c858410611a0a57945050505050611a05965051936119d5856116a1565b84528b8401528683015260608201528760808201526119f4828c6117dd565b526119ff818b6117dd565b506117cf565b61192a565b8b83611a92969798999a9b9c9d52600f83528b611a2a8684842092611b27565b82528352868282205416938c825260048452828220611a498287611b27565b8352845282822054938d835260068152611a668484209287611b27565b835252205491611a7684896117dd565b52611a8183896117dd565b52611a8c82896117dd565b526117cf565b908a979695949392918d8f6119b7565b8451611aad816116a1565b8681526060808483015280878301528082015286608082015282828d01015201879061191e565b90505f6118ec565b50505050505050611aeb61185b565b90565b15611af557565b60405162461bcd60e51b815260206004820152600a60248201526927b7363c9037bbb732b960b11b6044820152606490fd5b906040519060208201926001600160601b03199060601b1683526034820152603481526060810181811067ffffffffffffffff8211176116bd5760405251902090565b9190916040519160208301936001600160601b0319809360601b168552603484015260601b166054820152604881526080810181811067ffffffffffffffff8211176116bd5760405251902090565b611bd0611bc75f544261187e565b60015490611818565b600181018091116110b7579056fea264697066735822122042f8a05b2c4b5157169ca1142f7988fcf13fc3783603fc91e2f2fdfab8efdcca64736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.