Contract 0x19a812DA12D50D917D7d4078228E646eDcc38B20

 

Contract Overview

Balance:
0 MATIC

MATIC Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x10a655ae1096f335f0685e0a0d576a640b3f3aaf056c0f22e97d1977dd823b200x60806040200227472021-10-09 12:42:09106 days 8 hrs ago0xb0dd96118594903bacb2746eb228550c10b2b1da IN  Create: ClaimLogic0 MATIC0.0237401730
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ClaimLogic

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 6 : IAaveIncentives.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IAaveIncentives {
	function REWARD_TOKEN() external view returns (address);

	function getRewardsBalance(address[] calldata _assets, address user)
		external
		view
		returns (uint256);

	function assets(address aToken)
		external
		view
		returns (
			uint128 emissionPerSecond,
			uint128 lastUpdateTimestamp,
			uint256 index
		);

	function getUserUnclaimedRewards(address _user)
		external
		view
		returns (uint256);

	function claimRewards(
		address[] calldata _assets,
		uint256 amount,
		address to
	) external returns (uint256);
}

File 2 of 6 : IDistributionFactory.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IDistributionFactory {
	function stakingRewardsInfoByStakingToken(address erc20)
		external
		view
		returns (address);
}

File 3 of 6 : IProtocolDistribution.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IProtocolDistribution {
	function stake(uint256 amount) external;

	function withdraw(uint256 amount) external;

	function getReward(address user) external;

	function earned(address user) external view returns (uint256);

	function balanceOf(address account) external view returns (uint256);

	function rewardsToken() external view returns (address);

	function rewardPerToken() external view returns (uint256);
}

File 4 of 6 : IRegistry.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @title RegistryInterface Interface
 */
interface IRegistry {
	function logic(address logicAddr) external view returns (bool);

	function implementation(bytes32 key) external view returns (address);

	function notAllowed(address erc20) external view returns (bool);

	function deployWallet() external returns (address);

	function wallets(address user) external view returns (address);

	function getFee() external view returns (uint256);

	function getFeeManager() external view returns (address);

	function feeRecipient() external view returns (address);

	function memoryAddr() external view returns (address);

	function distributionContract(address token)
		external
		view
		returns (address);
}

File 5 of 6 : IWallet.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IWallet {
	event LogMint(address indexed erc20, uint256 tokenAmt);
	event LogRedeem(address indexed erc20, uint256 tokenAmt);
	event LogBorrow(address indexed erc20, uint256 tokenAmt);
	event LogPayback(address indexed erc20, uint256 tokenAmt);
	event LogDeposit(address indexed erc20, uint256 tokenAmt);
	event LogWithdraw(address indexed erc20, uint256 tokenAmt);
	event LogSwap(address indexed src, address indexed dest, uint256 amount);
	event LogLiquidityAdd(
		address indexed tokenA,
		address indexed tokenB,
		uint256 amountA,
		uint256 amountB
	);
	event LogLiquidityRemove(
		address indexed tokenA,
		address indexed tokenB,
		uint256 amountA,
		uint256 amountB
	);
	event VaultDeposit(address indexed erc20, uint256 tokenAmt);
	event VaultWithdraw(address indexed erc20, uint256 tokenAmt);
	event VaultClaim(address indexed erc20, uint256 tokenAmt);
	event DelegateAdded(address delegate);
	event DelegateRemoved(address delegate);
	event Claim(address indexed erc20, uint256 tokenAmt);
	event Staked(address indexed erc20, uint256 tokenAmt);
	event Unstaked(address indexed erc20, uint256 tokenAmt);

	function executeMetaTransaction(bytes memory sign, bytes memory data)
		external;

	function execute(address[] calldata targets, bytes[] calldata datas)
		external
		payable;

	function owner() external view returns (address);

	function registry() external view returns (address);

	function DELEGATE_ROLE() external view returns (bytes32);

	function hasRole(bytes32, address) external view returns (bool);
}

File 6 of 6 : ClaimLogic.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import "../interfaces/IProtocolDistribution.sol";
import "../interfaces/IProtocolDistribution.sol";
import "../interfaces/IDistributionFactory.sol";
import "../interfaces/IRegistry.sol";
import "../interfaces/IWallet.sol";
import "../interfaces/IAaveIncentives.sol";

/**
 * @title Claim ETHA rewards for interacting with Lending Protocols
 */
contract ClaimLogic {
	event Claim(address indexed erc20, uint256 tokenAmt);

	address public constant WMATIC = 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270;

	/**
	 * @dev get vault distribution factory address
	 */
	function getVaultDistributionFactory() public pure returns (address) {
		return 0xdB05A386810c809aD5a77422eb189D36c7f24402;
	}

	/**
	 * @dev get Aave MATIC incentives distribution contract
	 */
	function getAaveIncentivesAddress() public pure returns (address) {
		return 0x357D51124f59836DeD84c8a1730D72B749d8BC23;
	}

	/**
	 * @dev get lending distribution contract address
	 */
	function getLendingDistributionAddress(address token)
		public
		view
		returns (address)
	{
		return
			IRegistry(IWallet(address(this)).registry()).distributionContract(
				token
			);
	}

	/**
	 * @notice read aave rewards in MATIC
	 */
	function getRewardsAave(address[] memory tokens, address user)
		external
		view
		returns (uint256)
	{
		return
			IAaveIncentives(getAaveIncentivesAddress()).getRewardsBalance(
				tokens,
				user
			);
	}

	/**
	 * @notice read lending rewards in ETHA
	 */
	function getRewardsLending(address erc20, address user)
		external
		view
		returns (uint256)
	{
		return
			IProtocolDistribution(getLendingDistributionAddress(erc20)).earned(
				user
			);
	}

	/**
	 * @notice read vaults rewards in ETHA
	 */
	function getRewardsVaults(address erc20, address user)
		external
		view
		returns (uint256)
	{
		address dist = IDistributionFactory(getVaultDistributionFactory())
			.stakingRewardsInfoByStakingToken(erc20);

		return IProtocolDistribution(dist).earned(user);
	}

	/**
	 * @notice claim vault ETHA rewards
	 */
	function claimRewardsVaults(address erc20) external {
		address dist = IDistributionFactory(getVaultDistributionFactory())
			.stakingRewardsInfoByStakingToken(erc20);

		uint256 _earned = IProtocolDistribution(dist).earned(address(this));
		address distToken = IProtocolDistribution(dist).rewardsToken();

		IProtocolDistribution(dist).getReward(address(this));

		emit Claim(distToken, _earned);
	}

	/**
	 * @notice claim lending ETHA rewards
	 */
	function claimRewardsLending(address erc20) external {
		uint256 _earned = IProtocolDistribution(
			getLendingDistributionAddress(erc20)
		).earned(address(this));

		IProtocolDistribution(getLendingDistributionAddress(erc20)).getReward(
			address(this)
		);

		address distToken = IProtocolDistribution(
			getLendingDistributionAddress(erc20)
		).rewardsToken();

		emit Claim(distToken, _earned);
	}

	/**
	 * @notice claim Aave MATIC rewards
	 */
	function claimAaveRewards(address[] calldata tokens, uint256 amount)
		external
	{
		IAaveIncentives(getAaveIncentivesAddress()).claimRewards(
			tokens,
			amount,
			address(this)
		);

		emit Claim(WMATIC, amount);
	}

	/**
	 * @notice claim lending ETHA rewards
	 */
	function claimRewardsLendingOld(address _stakingContract) external {
		uint256 _earned = IProtocolDistribution(_stakingContract).earned(
			address(this)
		);

		IProtocolDistribution(_stakingContract).getReward(address(this));

		address distToken = IProtocolDistribution(_stakingContract)
			.rewardsToken();

		emit Claim(distToken, _earned);
	}
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc20","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmt","type":"uint256"}],"name":"Claim","type":"event"},{"inputs":[],"name":"WMATIC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claimAaveRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc20","type":"address"}],"name":"claimRewardsLending","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakingContract","type":"address"}],"name":"claimRewardsLendingOld","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc20","type":"address"}],"name":"claimRewardsVaults","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAaveIncentivesAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getLendingDistributionAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"address","name":"user","type":"address"}],"name":"getRewardsAave","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"getRewardsLending","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"getRewardsVaults","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVaultDistributionFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b50610d5b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063617cd60a11610071578063617cd60a14610142578063865c90ae14610155578063cc3fc5e214610168578063e5e9d0e214610182578063f6cf381c14610195578063fa6f74f1146101a857600080fd5b8063151c6819146100ae5780631bcecf9a146100c35780631cbc3a38146100d65780631e117779146100fc5780634d95cad91461010f575b600080fd5b6100c16100bc366004610a5d565b6101c2565b005b6100c16100d1366004610acd565b61036f565b6100e96100e4366004610a95565b610445565b6040519081526020015b60405180910390f35b6100e961010a366004610b43565b6104d1565b61012a730d500b1d8e8ef31e21c99d1db9a6444d3adf127081565b6040516001600160a01b0390911681526020016100f3565b6100e9610150366004610a95565b61050d565b61012a610163366004610a5d565b610623565b73db05a386810c809ad5a77422eb189d36c7f2440261012a565b6100c1610190366004610a5d565b610717565b6100c16101a3366004610a5d565b610826565b73357d51124f59836ded84c8a1730d72b749d8bc2361012a565b60006101cd82610623565b6040516246613160e11b81523060048201526001600160a01b039190911690628cc2629060240160206040518083038186803b15801561020c57600080fd5b505afa158015610220573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102449190610c1c565b905061024f82610623565b604051630c00007b60e41b81523060048201526001600160a01b03919091169063c00007b090602401600060405180830381600087803b15801561029257600080fd5b505af11580156102a6573d6000803e3d6000fd5b5050505060006102b583610623565b6001600160a01b031663d1af0c7d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ed57600080fd5b505afa158015610301573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103259190610a79565b9050806001600160a01b03167f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d48360405161036291815260200190565b60405180910390a2505050565b604051633111e7b360e01b815273357d51124f59836ded84c8a1730d72b749d8bc2390633111e7b3906103ac908690869086903090600401610c34565b602060405180830381600087803b1580156103c657600080fd5b505af11580156103da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fe9190610c1c565b50604051818152730d500b1d8e8ef31e21c99d1db9a6444d3adf1270907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d490602001610362565b600061045083610623565b6040516246613160e11b81526001600160a01b0384811660048301529190911690628cc262906024015b60206040518083038186803b15801561049257600080fd5b505afa1580156104a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ca9190610c1c565b9392505050565b6040516345accf9360e11b815260009073357d51124f59836ded84c8a1730d72b749d8bc2390638b599f269061047a9086908690600401610c9a565b60008073db05a386810c809ad5a77422eb189d36c7f24402604051630d9f195f60e31b81526001600160a01b0386811660048301529190911690636cf8caf89060240160206040518083038186803b15801561056857600080fd5b505afa15801561057c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a09190610a79565b6040516246613160e11b81526001600160a01b03858116600483015291925090821690628cc2629060240160206040518083038186803b1580156105e357600080fd5b505afa1580156105f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b9190610c1c565b949350505050565b6000306001600160a01b0316637b1039996040518163ffffffff1660e01b815260040160206040518083038186803b15801561065e57600080fd5b505afa158015610672573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106969190610a79565b60405163e1c2d4b560e01b81526001600160a01b038481166004830152919091169063e1c2d4b59060240160206040518083038186803b1580156106d957600080fd5b505afa1580156106ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107119190610a79565b92915050565b6040516246613160e11b81523060048201526000906001600160a01b03831690628cc2629060240160206040518083038186803b15801561075757600080fd5b505afa15801561076b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078f9190610c1c565b604051630c00007b60e41b81523060048201529091506001600160a01b0383169063c00007b090602401600060405180830381600087803b1580156107d357600080fd5b505af11580156107e7573d6000803e3d6000fd5b505050506000826001600160a01b031663d1af0c7d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ed57600080fd5b600073db05a386810c809ad5a77422eb189d36c7f24402604051630d9f195f60e31b81526001600160a01b0384811660048301529190911690636cf8caf89060240160206040518083038186803b15801561088057600080fd5b505afa158015610894573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b89190610a79565b6040516246613160e11b81523060048201529091506000906001600160a01b03831690628cc2629060240160206040518083038186803b1580156108fb57600080fd5b505afa15801561090f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109339190610c1c565b90506000826001600160a01b031663d1af0c7d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561097057600080fd5b505afa158015610984573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a89190610a79565b604051630c00007b60e41b81523060048201529091506001600160a01b0384169063c00007b090602401600060405180830381600087803b1580156109ec57600080fd5b505af1158015610a00573d6000803e3d6000fd5b50505050806001600160a01b03167f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d483604051610a3f91815260200190565b60405180910390a250505050565b8035610a5881610d0d565b919050565b600060208284031215610a6e578081fd5b81356104ca81610d0d565b600060208284031215610a8a578081fd5b81516104ca81610d0d565b60008060408385031215610aa7578081fd5b8235610ab281610d0d565b91506020830135610ac281610d0d565b809150509250929050565b600080600060408486031215610ae1578081fd5b833567ffffffffffffffff80821115610af8578283fd5b818601915086601f830112610b0b578283fd5b813581811115610b19578384fd5b8760208260051b8501011115610b2d578384fd5b6020928301989097509590910135949350505050565b60008060408385031215610b55578182fd5b823567ffffffffffffffff80821115610b6c578384fd5b818501915085601f830112610b7f578384fd5b8135602082821115610b9357610b93610cf7565b8160051b604051601f19603f83011681018181108682111715610bb857610bb8610cf7565b604052838152828101945085830182870184018b1015610bd6578889fd5b8896505b84871015610bff57610beb81610a4d565b865260019690960195948301948301610bda565b509650610c0f9050878201610a4d565b9450505050509250929050565b600060208284031215610c2d578081fd5b5051919050565b6060808252810184905260008560808301825b87811015610c77578235610c5a81610d0d565b6001600160a01b0316825260209283019290910190600101610c47565b50602084019590955250506001600160a01b039190911660409091015292915050565b604080825283519082018190526000906020906060840190828701845b82811015610cdc5781516001600160a01b031684529284019290840190600101610cb7565b5050506001600160a01b039490941692019190915250919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610d2257600080fd5b5056fea26469706673582212205807a59ffc3bed05e0f7c9d955bdf9ee6046fd49a005e714ef36ea20b76b829464736f6c63430008040033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.