Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x5DEf993e...03fa10aB7 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
RewardsSource
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.19;
import {IRewardsSource} from "../interfaces/IRewardsSource.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";
interface IAbraAddressProvider {
function abra() external view returns (address);
}
contract RewardsSource is IRewardsSource {
IERC20 public immutable ABRA;
address public immutable staking;
modifier onlyStaking {
require(msg.sender == staking, 'RewardsSource: onlyStaking');
_;
}
constructor(address _staking) {
staking = _staking;
ABRA = IERC20(IAbraAddressProvider(_staking).abra());
}
function previewRewards() public view returns(uint) {
return ABRA.balanceOf(address(this));
}
function collectRewards() external onlyStaking() {
uint reward = previewRewards();
if (reward > 0) {
ABRA.transfer(staking, reward);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.19;
interface IRewardsSource {
function previewRewards() external view returns(uint);
function collectRewards() external;
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_staking","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ABRA","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"previewRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x60c060405234801561001057600080fd5b506040516104c83803806104c883398101604081905261002f916100af565b6001600160a01b03811660a0819052604080516329b9624d60e21b8152905163a6e58934916004808201926020929091908290030181865afa158015610079573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061009d91906100af565b6001600160a01b0316608052506100df565b6000602082840312156100c157600080fd5b81516001600160a01b03811681146100d857600080fd5b9392505050565b60805160a0516103aa61011e6000396000818160560152818161010101526101db01526000818160b10152818161020a01526102ad01526103aa6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80634cf088d91461005157806370bb45b3146100a2578063be7d0c86146100ac578063e0d801dd146100d3575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100aa6100e9565b005b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100db61027c565b604051908152602001610099565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461018c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f52657761726473536f757263653a206f6e6c795374616b696e67000000000000604482015260640160405180910390fd5b600061019661027c565b90508015610279576040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610253573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102779190610332565b505b50565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d919061035b565b905090565b60006020828403121561034457600080fd5b8151801515811461035457600080fd5b9392505050565b60006020828403121561036d57600080fd5b505191905056fea264697066735822122052f4650dd79cf9e86a3caa61d1c0fbbeac33c78986e2d3ecdfb7bf395c6f4e6864736f6c634300081a00330000000000000000000000000c7fa6217af8b86aacf6d47897b018efc689c448
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80634cf088d91461005157806370bb45b3146100a2578063be7d0c86146100ac578063e0d801dd146100d3575b600080fd5b6100787f0000000000000000000000000c7fa6217af8b86aacf6d47897b018efc689c44881565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100aa6100e9565b005b6100787f00000000000000000000000065114046c6e73af794308547124ad5c8dce3be6f81565b6100db61027c565b604051908152602001610099565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000c7fa6217af8b86aacf6d47897b018efc689c448161461018c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f52657761726473536f757263653a206f6e6c795374616b696e67000000000000604482015260640160405180910390fd5b600061019661027c565b90508015610279576040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000c7fa6217af8b86aacf6d47897b018efc689c44881166004830152602482018390527f00000000000000000000000065114046c6e73af794308547124ad5c8dce3be6f169063a9059cbb906044016020604051808303816000875af1158015610253573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102779190610332565b505b50565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000065114046c6e73af794308547124ad5c8dce3be6f73ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d919061035b565b905090565b60006020828403121561034457600080fd5b8151801515811461035457600080fd5b9392505050565b60006020828403121561036d57600080fd5b505191905056fea264697066735822122052f4650dd79cf9e86a3caa61d1c0fbbeac33c78986e2d3ecdfb7bf395c6f4e6864736f6c634300081a0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.