Address Details
contract

0xa2bf67e12EeEDA23C7cA1e5a34ae2441a17789Ec

Contract Name
FarmRegistry
Creator
0x9cb673–764b9f at 0x74988e–4205a5
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
1,436,690 Transactions
Transfers
6 Transfers
Gas Used
21,013,213,343
Last Balance Update
25265911
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
FarmRegistry




Optimization enabled
true
Compiler version
v0.8.9+commit.e5eed63a




Optimization runs
200
EVM Version
london




Verified at
2021-11-13T12:16:17.818736Z

project:/contracts/FarmRegistry.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.3;

import "@openzeppelin/contracts/access/Ownable.sol";

interface ILP {
  function token0() external view returns (address);

  function token1() external view returns (address);
}

interface IFarm {
  function stakingToken() external view returns (address);
}

contract FarmRegistry is Ownable {
  event FarmInfo(
    address indexed stakingAddress,
    bytes32 indexed farmName,
    address indexed lpAddress
  );
  event LPInfo(
    address indexed lpAddress,
    address indexed token0Address,
    address indexed token1Address
  );
  event FarmData(
    address indexed stakingAddress,
    uint256 indexed tvlUSD,
    uint256 indexed rewardsUSDPerYear
  );

  constructor() {}

  function addFarmInfo(bytes32 farmName, IFarm farm) public onlyOwner {
    ILP lp = ILP(farm.stakingToken());
    emit FarmInfo(address(farm), farmName, address(lp));
    emit LPInfo(address(lp), lp.token0(), lp.token1());
  }

  function updateFarmData(
    address farm,
    uint256 tvlUSD,
    uint256 rewardsUSDPerYear
  ) public onlyOwner {
    emit FarmData(farm, tvlUSD, rewardsUSDPerYear);
  }
}
        

/_openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

/_openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
          

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"FarmData","inputs":[{"type":"address","name":"stakingAddress","internalType":"address","indexed":true},{"type":"uint256","name":"tvlUSD","internalType":"uint256","indexed":true},{"type":"uint256","name":"rewardsUSDPerYear","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"FarmInfo","inputs":[{"type":"address","name":"stakingAddress","internalType":"address","indexed":true},{"type":"bytes32","name":"farmName","internalType":"bytes32","indexed":true},{"type":"address","name":"lpAddress","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"LPInfo","inputs":[{"type":"address","name":"lpAddress","internalType":"address","indexed":true},{"type":"address","name":"token0Address","internalType":"address","indexed":true},{"type":"address","name":"token1Address","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addFarmInfo","inputs":[{"type":"bytes32","name":"farmName","internalType":"bytes32"},{"type":"address","name":"farm","internalType":"contract IFarm"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateFarmData","inputs":[{"type":"address","name":"farm","internalType":"address"},{"type":"uint256","name":"tvlUSD","internalType":"uint256"},{"type":"uint256","name":"rewardsUSDPerYear","internalType":"uint256"}]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105848061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80631481ec381461005c578063715018a6146100715780638da5cb5b14610079578063c8a4a28d14610098578063f2fde38b146100ab575b600080fd5b61006f61006a366004610473565b6100be565b005b61006f61012e565b600054604080516001600160a01b039092168252519081900360200190f35b61006f6100a63660046104a8565b610164565b61006f6100b93660046104d8565b610373565b6000546001600160a01b031633146100f15760405162461bcd60e51b81526004016100e8906104fc565b60405180910390fd5b8082846001600160a01b03167f951423e75f8b5d5cffb9a83d640b2ec60f7037c906ab1805cfe84271a228159e60405160405180910390a4505050565b6000546001600160a01b031633146101585760405162461bcd60e51b81526004016100e8906104fc565b610162600061040e565b565b6000546001600160a01b0316331461018e5760405162461bcd60e51b81526004016100e8906104fc565b6000816001600160a01b03166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156101c957600080fd5b505afa1580156101dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102019190610531565b9050806001600160a01b031683836001600160a01b03167fac28e76ec54916c2a817267091ae49d56a2c8a56911be75981d2b58b638e027560405160405180910390a4806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561027d57600080fd5b505afa158015610291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b59190610531565b6001600160a01b0316816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156102f757600080fd5b505afa15801561030b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032f9190610531565b6001600160a01b0316826001600160a01b03167f50437cc43dd454276017c18941adfd8b8fdfc8cdaa70baa1cc4052c4103be1b760405160405180910390a4505050565b6000546001600160a01b0316331461039d5760405162461bcd60e51b81526004016100e8906104fc565b6001600160a01b0381166104025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100e8565b61040b8161040e565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461040b57600080fd5b60008060006060848603121561048857600080fd5b83356104938161045e565b95602085013595506040909401359392505050565b600080604083850312156104bb57600080fd5b8235915060208301356104cd8161045e565b809150509250929050565b6000602082840312156104ea57600080fd5b81356104f58161045e565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561054357600080fd5b81516104f58161045e56fea26469706673582212207ad6d9f03b8a839de3fc4184c4b04292e95ba05e5a64e1d8c91fe39180b3c1f364736f6c63430008090033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c80631481ec381461005c578063715018a6146100715780638da5cb5b14610079578063c8a4a28d14610098578063f2fde38b146100ab575b600080fd5b61006f61006a366004610473565b6100be565b005b61006f61012e565b600054604080516001600160a01b039092168252519081900360200190f35b61006f6100a63660046104a8565b610164565b61006f6100b93660046104d8565b610373565b6000546001600160a01b031633146100f15760405162461bcd60e51b81526004016100e8906104fc565b60405180910390fd5b8082846001600160a01b03167f951423e75f8b5d5cffb9a83d640b2ec60f7037c906ab1805cfe84271a228159e60405160405180910390a4505050565b6000546001600160a01b031633146101585760405162461bcd60e51b81526004016100e8906104fc565b610162600061040e565b565b6000546001600160a01b0316331461018e5760405162461bcd60e51b81526004016100e8906104fc565b6000816001600160a01b03166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156101c957600080fd5b505afa1580156101dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102019190610531565b9050806001600160a01b031683836001600160a01b03167fac28e76ec54916c2a817267091ae49d56a2c8a56911be75981d2b58b638e027560405160405180910390a4806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561027d57600080fd5b505afa158015610291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b59190610531565b6001600160a01b0316816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156102f757600080fd5b505afa15801561030b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032f9190610531565b6001600160a01b0316826001600160a01b03167f50437cc43dd454276017c18941adfd8b8fdfc8cdaa70baa1cc4052c4103be1b760405160405180910390a4505050565b6000546001600160a01b0316331461039d5760405162461bcd60e51b81526004016100e8906104fc565b6001600160a01b0381166104025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100e8565b61040b8161040e565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461040b57600080fd5b60008060006060848603121561048857600080fd5b83356104938161045e565b95602085013595506040909401359392505050565b600080604083850312156104bb57600080fd5b8235915060208301356104cd8161045e565b809150509250929050565b6000602082840312156104ea57600080fd5b81356104f58161045e565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561054357600080fd5b81516104f58161045e56fea26469706673582212207ad6d9f03b8a839de3fc4184c4b04292e95ba05e5a64e1d8c91fe39180b3c1f364736f6c63430008090033