Contract Address Details

0x720cc389d3aef479D0C6acEFAbd9eabe7aEb0DEa

Contract Name
AthenaTaxOracle
Creator
0xafa414–714ba5 at 0x2463ae–557c84
Balance
0 MOVR
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
3132011
Contract name:
AthenaTaxOracle




Optimization enabled
true
Compiler version
v0.8.4+commit.c7e474f2




Optimization runs
200
EVM Version
default




Verified at
2022-01-14 15:51:48.782138Z

Constructor Arguments

0000000000000000000000005c2da48241d3be9626dd0c48081c76dbb6d1046e00000000000000000000000098878b06940ae243284ca214f92bb71a2b032b8a000000000000000000000000c881c93ebb075b3c80f16bc9e513a7784f794ef9

Arg [0] (address) : 0x5c2da48241d3be9626dd0c48081c76dbb6d1046e
Arg [1] (address) : 0x98878b06940ae243284ca214f92bb71a2b032b8a
Arg [2] (address) : 0xc881c93ebb075b3c80f16bc9e513a7784f794ef9

              

Contract source code

// Sources flattened with hardhat v2.8.0 https://hardhat.org
// File @openzeppelin/contracts/utils/math/SafeMath.sol@v4.4.1
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File @openzeppelin/contracts/utils/Context.sol@v4.4.1
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
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;
}
}
// File @openzeppelin/contracts/access/Ownable.sol@v4.4.1
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @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() {
_transferOwnership(_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 {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.4.1
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) 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 `amount` 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 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @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);
}
// File contracts/TaxOracle.sol
pragma solidity ^0.8.0;
/*
_____ __ .__ _____
/ _ \_/ |_| |__ ____ ____ _____ / \ ____ ____ ____ ___.__.
/ /_\ \ __\ | \_/ __ \ / \\__ \ / \ / \ / _ \ / \_/ __ < | |
/ | \ | | Y \ ___/| | \/ __ \_ / Y ( <_> ) | \ ___/\___ |
\____|__ /__| |___| /\___ >___| (____ / \____|__ /\____/|___| /\___ > ____|
\/ \/ \/ \/ \/ \/ \/ \/\/
http://athena.money
*/
contract AthenaTaxOracle is Ownable {
using SafeMath for uint256;
IERC20 public athena;
IERC20 public wftm;
address public pair;
constructor(
address _athena,
address _wftm,
address _pair
) {
require(_athena != address(0), "athena address cannot be 0");
require(_wftm != address(0), "wftm address cannot be 0");
require(_pair != address(0), "pair address cannot be 0");
athena = IERC20(_athena);
wftm = IERC20(_wftm);
pair = _pair;
}
function consult(address _token, uint256 _amountIn) external view returns (uint144 amountOut) {
require(_token == address(athena), "token needs to be athena");
uint256 athenaBalance = athena.balanceOf(pair);
uint256 wftmBalance = wftm.balanceOf(pair);
return uint144(athenaBalance.div(wftmBalance));
}
function setAthena(address _athena) external onlyOwner {
require(_athena != address(0), "athena address cannot be 0");
athena = IERC20(_athena);
}
function setWftm(address _wftm) external onlyOwner {
require(_wftm != address(0), "wftm address cannot be 0");
wftm = IERC20(_wftm);
}
function setPair(address _pair) external onlyOwner {
require(_pair != address(0), "pair address cannot be 0");
pair = _pair;
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_athena","internalType":"address"},{"type":"address","name":"_wftm","internalType":"address"},{"type":"address","name":"_pair","internalType":"address"}]},{"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":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"athena","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint144","name":"amountOut","internalType":"uint144"}],"name":"consult","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"uint256","name":"_amountIn","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pair","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAthena","inputs":[{"type":"address","name":"_athena","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPair","inputs":[{"type":"address","name":"_pair","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWftm","inputs":[{"type":"address","name":"_wftm","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"wftm","inputs":[]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b14610121578063a8aa1b3114610146578063cc722c9714610159578063f2fde38b1461016c578063f4f45b461461017f57600080fd5b80633cac8b31146100a35780633ddac953146100b8578063545e8857146100f3578063715018a6146101065780638187f5161461010e575b600080fd5b6100b66100b136600461064f565b610192565b005b6100cb6100c6366004610669565b61023d565b60405171ffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100b661010136600461064f565b6103bb565b6100b661045d565b6100b661011c36600461064f565b610493565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016100ea565b60035461012e906001600160a01b031681565b60015461012e906001600160a01b031681565b6100b661017a36600461064f565b610535565b60025461012e906001600160a01b031681565b6000546001600160a01b031633146101c55760405162461bcd60e51b81526004016101bc906106aa565b60405180910390fd5b6001600160a01b03811661021b5760405162461bcd60e51b815260206004820152601a60248201527f617468656e6120616464726573732063616e6e6f74206265203000000000000060448201526064016101bc565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546000906001600160a01b0384811691161461029d5760405162461bcd60e51b815260206004820152601860248201527f746f6b656e206e6565647320746f20626520617468656e61000000000000000060448201526064016101bc565b6001546003546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a082319060240160206040518083038186803b1580156102e957600080fd5b505afa1580156102fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103219190610692565b6002546003546040516370a0823160e01b81526001600160a01b0391821660048201529293506000929116906370a082319060240160206040518083038186803b15801561036e57600080fd5b505afa158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a69190610692565b90506103b282826105d0565b95945050505050565b6000546001600160a01b031633146103e55760405162461bcd60e51b81526004016101bc906106aa565b6001600160a01b03811661043b5760405162461bcd60e51b815260206004820152601860248201527f7766746d20616464726573732063616e6e6f742062652030000000000000000060448201526064016101bc565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146104875760405162461bcd60e51b81526004016101bc906106aa565b61049160006105e3565b565b6000546001600160a01b031633146104bd5760405162461bcd60e51b81526004016101bc906106aa565b6001600160a01b0381166105135760405162461bcd60e51b815260206004820152601860248201527f7061697220616464726573732063616e6e6f742062652030000000000000000060448201526064016101bc565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461055f5760405162461bcd60e51b81526004016101bc906106aa565b6001600160a01b0381166105c45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101bc565b6105cd816105e3565b50565b60006105dc82846106df565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461064a57600080fd5b919050565b600060208284031215610660578081fd5b6105dc82610633565b6000806040838503121561067b578081fd5b61068483610633565b946020939093013593505050565b6000602082840312156106a3578081fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000826106fa57634e487b7160e01b81526012600452602481fd5b50049056fea26469706673582212201d9e2cfd14f8b35036b219408f0a9e3fc9ce26d3dc30f0949a2c29d93193c1d064736f6c63430008040033