Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BoosterFeeDistro
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import { IDeposit, IBoosterFeeDistro } from "./Interfaces.sol";
import { IAuraLocker } from "../interfaces/IAuraLocker.sol";
import { SafeMath } from "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import { IERC20 } from "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
import { Ownable } from "@openzeppelin/contracts-0.6/access/Ownable.sol";
/**
* @title BoosterFeeDistro
* @author Hyperlock Finance
*/
contract BoosterFeeDistro is IBoosterFeeDistro, Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public immutable crv;
address public immutable booster;
address public immutable lockRewards;
address public immutable stakerRewards;
uint256 public pendingLockIncentive;
uint256 public pendingStakerIncentive;
uint256 public pendingCallIncentive;
// @dev Authorized address that can call queueNewRewards
mapping(address => bool) public authorized;
/* -------------------------------------------------------------------
Events
------------------------------------------------------------------- */
event SetAuthorized(address user, bool auth);
event Distributed(uint256 lockIncentive, uint256 stakerIncentive, uint256 callIncentive);
event RewardAdded(uint256 lockIncentive, uint256 stakerIncentive, uint256 callIncentive);
/* -------------------------------------------------------------------
Constructor
------------------------------------------------------------------- */
/**
* @param _booster The booster
*/
constructor(address _booster) public {
address _lockRewards = IDeposit(_booster).lockRewards();
require(_lockRewards != address(0), "!lockRewards");
crv = IDeposit(_booster).crv();
booster = _booster;
lockRewards = _lockRewards;
stakerRewards = IDeposit(_booster).stakerRewards();
authorized[_booster] = true;
emit SetAuthorized(_booster, true);
}
/**
* Allows contract owner to authorized a given user to call queueNewRewards.
* @param user The address to authorize.
* @param auth Whether the user is authorized or not.
*/
function setAuthorized(address user, bool auth) external onlyOwner {
authorized[user] = auth;
emit SetAuthorized(user, auth);
}
/**
* @dev Called by the booster to allocate new Crv rewards.
*/
function queueNewRewards(
uint256 _lockIncentive,
uint256 _stakerIncentive,
uint256 _callIncentive
) external override {
require(authorized[msg.sender], "!auth");
pendingLockIncentive = pendingLockIncentive.add(_lockIncentive);
pendingStakerIncentive = pendingStakerIncentive.add(_stakerIncentive);
pendingCallIncentive = pendingCallIncentive.add(_callIncentive);
emit RewardAdded(_lockIncentive, _stakerIncentive, _callIncentive);
}
/**
* @dev Distribute pending fees to lockRewards and stakerRewards, additionally it transfers callIncentive to the caller.
*/
function distributeFees() external {
uint256 lockIncentive = pendingLockIncentive;
if (lockIncentive > 0) {
pendingLockIncentive = 0;
//send lockers' share of crv to reward contract (vault.strategy)
IERC20(crv).safeTransfer(lockRewards, lockIncentive);
}
uint256 stakerIncentive = pendingStakerIncentive;
if (stakerIncentive > 0) {
pendingStakerIncentive = 0;
//send stakers's share of crv to reward contract
IERC20(crv).safeApprove(stakerRewards, 0);
IERC20(crv).safeApprove(stakerRewards, stakerIncentive);
IAuraLocker(stakerRewards).queueNewRewards(crv, stakerIncentive);
}
uint256 callIncentive = pendingCallIncentive;
if (callIncentive > 0 && (lockIncentive > 0 || stakerIncentive > 0)) {
pendingCallIncentive = 0;
//send incentives for calling
IERC20(crv).safeTransfer(msg.sender, callIncentive);
}
emit Distributed(lockIncentive, stakerIncentive, callIncentive);
}
/**
* @dev It calculates the delta between the crv balance and the the total pending incentives
*/
function skimmableIncentive() public view returns (uint256) {
uint256 bal = IERC20(crv).balanceOf(address(this));
uint256 totalPending = pendingLockIncentive.add(pendingStakerIncentive).add(pendingCallIncentive);
return bal.sub(totalPending);
}
/**
* @dev As this contract can receive CRV directly from other sources .i.e Merkle. It calculates the amount of skimmable incentives
* for locking, staking, and earmarking then these incentives are then added to the pending incentive variables.
*/
function skim() external {
uint256 skimmable = skimmableIncentive();
if (skimmable > 0) {
uint256 lockIncentive = IDeposit(booster).lockIncentive();
uint256 stakerIncentive = IDeposit(booster).stakerIncentive();
uint256 earmarkIncentive = IDeposit(booster).earmarkIncentive();
uint256 totalIncentive = lockIncentive.add(stakerIncentive).add(earmarkIncentive);
pendingLockIncentive = pendingLockIncentive.add(skimmable.mul(lockIncentive).div(totalIncentive));
pendingStakerIncentive = pendingStakerIncentive.add(skimmable.mul(stakerIncentive).div(totalIncentive));
pendingCallIncentive = pendingCallIncentive.add(skimmable.mul(earmarkIncentive).div(totalIncentive));
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <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.
*/
/**
* @notice * This code is used to create a constructor function in a Solidity smart contract. It is used to initialize the contract and set the initial owner of the contract.
* @dev * The constructor function is declared as internal, meaning it can only be called from within the contract itself. It does not have a return type and is automatically executed when the contract is deployed.
* The first line of the function retrieves the address of the message sender, which is the account that is deploying the contract. This address is then assigned to the variable "msgSender".
* The next line sets the "_owner" variable to the value of "msgSender", making the deploying account the initial owner of the contract.
* Finally, the "OwnershipTransferred" event is emitted with the parameters of the previous owner (address(0), indicating no previous owner) and the new owner (msgSender).
* It is important to note that this constructor function can only be called once during the deployment of the contract. Any subsequent attempts to call it will result in an error.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
/**
* @notice * This function is used to retrieve the address of the owner of the contract.
* @dev * The function "owner" is a public, view and virtual function that returns the address of the contract owner. This function can be called by anyone and does not modify the state of the contract. It is used to retrieve the address of the owner, which is set during the contract deployment. This function can be useful for verifying the ownership of the contract or for implementing access control mechanisms.
*/
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.
*/
/**
* @notice * This function allows the current owner of the contract to renounce their ownership, effectively transferring ownership to address(0), which is a non-existent address. This means that there will no longer be an owner for the contract.
* @dev * This function is marked as virtual, which means it can be overridden by functions in derived contracts. It also has the modifier "onlyOwner", which restricts its execution to only the current owner of the contract. Upon execution, it emits an event called "OwnershipTransferred" with the parameters of the current owner and address(0). It then sets the _owner variable to address(0), effectively removing the current owner and transferring ownership to a non-existent address. This function should be used with caution as it permanently removes ownership from the contract.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
/**
* @notice * This function allows the current owner of the contract to transfer ownership to a new address. The new owner must not be the zero address. This function emits an event to notify listeners of the ownership transfer.
* @dev * The transferOwnership function is a public and virtual function that can only be called by the current owner of the contract. It takes in a newOwner address as a parameter and checks that it is not the zero address. If the condition is met, the function emits an OwnershipTransferred event with the current owner and the new owner as parameters. The _owner variable is then updated with the new owner address. This function is used to transfer ownership of the contract to a new address.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
/**
* @notice * This function is used to add two unsigned integers and return a boolean value and the sum of the two integers. It is an internal function and can only be called within the contract it is defined in.
* @dev * The function takes in two parameters, both of type uint256, and assigns the sum of the two parameters to a new variable c. It then checks if the sum is less than the first parameter, which would indicate an overflow. If an overflow occurs, the function returns a boolean value of false and a sum of 0. Otherwise, it returns a boolean value of true and the sum of the two parameters. This function is useful for preventing overflows when adding two unsigned integers.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
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._
*/
/**
* @notice * This function is used to subtract two unsigned integers and returns a boolean value and the result of the subtraction. It is an internal function and can only be called within the contract.
* Parameters:
* - a: The first unsigned integer to be subtracted from.
* - b: The second unsigned integer to be subtracted.
* Returns:
* - bool: A boolean value indicating whether the subtraction was successful or not.
* - uint256: The result of the subtraction.
* Development:
* - This function is pure, meaning it does not modify any state variables or emit any events.
* - It is an internal function, so it can only be called within the contract.
* - The function first checks if the second integer (b) is greater than the first integer (a). If this is the case, it will return a boolean value of false and a result of 0.
* - If b is not greater than a, the function will return a boolean value of true and the result of the subtraction (a - b).
* - This function can be used to prevent underflow when subtracting two unsigned integers.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
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._
*/
/**
* @notice * This function is used for gas optimization and checks if the multiplication of two uint256 values will result in an overflow. It returns a boolean value indicating if the multiplication was successful and the result of the multiplication.
* @dev * The function takes in two uint256 values, 'a' and 'b', and performs the multiplication operation on them. It first checks if 'a' is equal to 0, and if so, it returns a boolean value of true and a result of 0. This is done to save gas costs by avoiding the requirement of 'a' not being zero.
* Next, the function performs the multiplication operation and stores the result in a new uint256 variable 'c'. It then checks if the result of the division of 'c' by 'a' is equal to 'b'. If not, it means that an overflow has occurred and the function returns a boolean value of false and a result of 0.
* If the multiplication is successful and no overflow occurs, the function returns a boolean value of true and the result of the multiplication stored in 'c'.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// 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._
*/
/**
* @notice * This function is used to divide two unsigned integers and returns a boolean value and the result of the division. It is an internal function and can only be called within the contract.
* @dev * The function takes in two parameters, both of type uint256, and checks if the second parameter is equal to 0. If it is, the function returns a boolean value of false and a result of 0. If the second parameter is not equal to 0, the function returns a boolean value of true and the result of the division of the first parameter by the second parameter. This function is pure, meaning it does not modify any state variables and only returns a value. It is recommended to use this function for division operations to avoid potential errors or exceptions.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
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._
*/
/**
* @notice * This function is used to perform the modulo operation on two unsigned integers. It checks if the second integer is equal to 0 and returns false if it is, otherwise it returns true and the result of the modulo operation.
* @dev * The function takes in two parameters, both of type uint256, and is marked as internal, meaning it can only be called from within the contract. It is also marked as pure, indicating that it does not modify any state variables and only returns a value.
* The first parameter, 'a', represents the dividend and the second parameter, 'b', represents the divisor. The function first checks if 'b' is equal to 0, which would result in an error if used as a divisor. If 'b' is indeed 0, the function returns false and 0 as the result.
* If 'b' is not equal to 0, the function performs the modulo operation on 'a' and 'b' and returns true along with the result. This result is of type uint256, which is the same as the input parameters.
* This function can be useful for performing calculations that require the remainder of a division, such as determining if a number is even or odd. It is important to note that this function does not handle negative numbers, as the modulo operation on negative numbers can produce unexpected results.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
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.
*/
/**
* @notice * This function, named "add", takes in two unsigned 256-bit integers, "a" and "b", and returns their sum as an unsigned 256-bit integer. It is an internal function, meaning it can only be called from within the contract it is defined in. This function does not modify any state variables and is therefore marked as "pure".
* @dev * The function first declares a new unsigned 256-bit integer variable, "c", and assigns it the value of "a" plus "b". It then uses a require statement to check if the sum of "a" and "b" is greater than or equal to "a". If this condition is not met, the function will revert with the error message "SafeMath: addition overflow". Finally, the function returns the value of "c".
* This function is useful for preventing integer overflow when adding two large numbers. It is recommended to use this function instead of the "+" operator when dealing with unsigned integers in order to ensure safe addition.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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.
*/
/**
* @notice * This function is used for subtracting two unsigned integers. It is an internal function, meaning it can only be called within the contract it is defined in. It is also marked as pure, meaning it does not modify any state variables and only returns a value.
* @dev * The function takes in two parameters, a and b, both of type uint256. It first checks if b is less than or equal to a using the require statement. If this condition is not met, the function will revert with the error message "SafeMath: subtraction overflow". If the condition is met, the function will return the result of a - b. This ensures that the subtraction operation does not result in an overflow, which can lead to unexpected behavior in the contract.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
/**
* @notice * This function is used for multiplying two unsigned integers and ensuring that there is no overflow. It is an internal function and cannot be accessed outside of the contract.
* @dev * The function takes in two parameters, a and b, both of type uint256. It then multiplies them and stores the result in a new variable c. The function then checks if the result of the multiplication is equal to the original value of a multiplied by b. If it is not equal, it will throw an error message stating "SafeMath: multiplication overflow". This ensures that there is no overflow in the multiplication process.
* If the value of a is 0, the function will return 0 without performing any multiplication. This is to prevent any potential errors or unexpected results.
* This function is marked as internal, meaning it can only be accessed within the contract and not by external contracts or accounts. It is also marked as pure, indicating that it does not modify any state variables and only returns a value.
* It is important to use this function when performing multiplication in order to prevent any potential overflow errors and ensure the accuracy of the result.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @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. 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.
*/
/**
* @notice * This function is used for dividing two unsigned integers and returns the result as an unsigned integer. It is important to note that the second input parameter (b) must be greater than 0, otherwise the function will throw an error. This function is part of the SafeMath library and is intended to prevent potential errors or vulnerabilities in the code.
* @dev * The div function is an internal function, meaning it can only be called within the contract it is defined in. It takes in two unsigned integers (a and b) as input parameters and returns an unsigned integer as the result of the division. The require statement ensures that the second input parameter (b) is greater than 0, otherwise the function will throw an error and the division will not be executed.
* This function is part of the SafeMath library, which is a commonly used library in Solidity to prevent potential errors or vulnerabilities in mathematical operations. It is important to use this library when dealing with mathematical operations in order to avoid potential issues such as integer overflow or division by zero.
* Overall, the div function is a crucial part of the SafeMath library and should be used whenever dividing two unsigned integers in Solidity. It is important to note the requirement for the second input parameter (b) to be greater than 0 in order for the function to execute successfully.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
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.
*/
/**
* @notice * This function is used to calculate the modulo of two unsigned integers. It is an internal function and can only be accessed within the contract. It is important to note that the second parameter (b) must be greater than 0, otherwise the function will revert with an error message.
* @dev * The function takes in two parameters, a and b, both of type uint256. It then checks if b is greater than 0 using the require statement. If b is not greater than 0, the function will revert with the error message "SafeMath: modulo by zero". If b is greater than 0, the function will return the modulo of a and b using the % operator. This function does not modify any state variables and is therefore marked as pure. It is an internal function and can only be accessed within the contract.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
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.
*/
/**
* @notice * This function is used to subtract two unsigned integers and return the result. It takes in three parameters: a, b, and errorMessage. The function will throw an error if b is greater than a. Otherwise, it will return the result of a - b.
* @dev * The function is defined as internal, meaning it can only be called within the contract. It is also marked as pure, indicating that it does not modify the state of the contract.
* Parameters:
* - a: an unsigned integer representing the minuend
* - b: an unsigned integer representing the subtrahend
* - errorMessage: a string containing the error message to be thrown if b is greater than a
* Returns:
* - uint256: the result of a - b
* Requirements:
* - b must be less than or equal to a, otherwise an error will be thrown.
* Usage:
* This function can be used to subtract two unsigned integers and handle potential errors. It is recommended to use this function instead of the built-in subtraction operator (-) to ensure proper error handling.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
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.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* 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.
*/
/**
* @notice * This function is used to divide two unsigned integers and return the result. It also includes an error message in case the second integer is equal to zero, preventing a potential division by zero error.
* @dev * The function "div" takes in three parameters: "a" and "b" which are both unsigned integers, and "errorMessage" which is a string. It is an internal function, meaning it can only be called within the contract it is defined in.
* The first line of the function checks if the value of "b" is greater than zero, and if not, it will trigger the "require" statement and revert the transaction with the provided error message.
* If the value of "b" is greater than zero, the function will return the result of dividing "a" by "b".
* This function is pure, meaning it does not modify any state variables and only returns a value. It is commonly used for mathematical operations within a contract.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
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.
*/
/**
* @notice * This function is used to calculate the modulus of two unsigned integers. It takes in three parameters: a, b, and errorMessage. The function will return the remainder of a divided by b. It is important to note that b must be greater than 0, otherwise an error message will be displayed.
* @dev * The function is defined as internal, meaning it can only be called within the contract it is defined in. It is also marked as pure, indicating that it does not modify any state variables and only returns a value. This function is useful for performing mathematical calculations within a smart contract. It is important to provide a descriptive errorMessage in case the b parameter is 0, as this would result in an error and the transaction would fail.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
/**
* @notice * This function is used to retrieve the total supply of a specific token. It is an external function, meaning it can be called by other contracts or externally owned accounts. It does not modify the state of the contract and therefore does not require any gas to be executed. This function is useful for obtaining information about the total amount of tokens in circulation.
* @dev * The totalSupply() function is a built-in function in the Solidity programming language. It is used to retrieve the total supply of a specific token. The function is declared as external, which means it can be called by other contracts or externally owned accounts. The function does not modify the state of the contract, therefore it does not require any gas to be executed.
* The function returns a uint256 value, which represents the total supply of the token. This value can be used for various purposes, such as displaying the total supply on a user interface or performing calculations.
* It is important to note that this function does not have any input parameters, as it simply retrieves the total supply from the contract's state variables. Therefore, it is a read-only function and does not require any transaction to be executed.
* Overall, the totalSupply() function is a useful tool for obtaining information about the total amount of tokens in circulation and can be used in various scenarios within a Solidity contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
/**
* @notice * This function is used to retrieve the balance of a specific account in the contract. It takes in the address of the account as a parameter and returns the balance as a uint256 value. This function is a view function, meaning it does not modify the state of the contract and can be called without incurring any gas fees.
* @dev * The balanceOf function is a built-in function in the Solidity programming language. It is used to retrieve the balance of a specific account in the contract. The function takes in the address of the account as a parameter and returns the balance as a uint256 value. This function is useful for checking the balance of a particular account, such as a user's wallet or a smart contract's balance.
* To use this function, the contract must be deployed on the blockchain and have a balance. The function can then be called by passing in the address of the account whose balance is to be retrieved. The function will return the balance of the account in the form of a uint256 value.
* It is important to note that this function is a view function, meaning it does not modify the state of the contract. Therefore, it can be called without incurring any gas fees. This makes it a cost-effective way to retrieve the balance of an account in the contract.
* Overall, the balanceOf function is a useful tool for developers to check the balance of specific accounts in their contracts. It can be used for various purposes, such as tracking user balances, managing funds
*/
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.
*/
/**
* @notice * This function allows the transfer of a specified amount of tokens from the sender's address to the recipient's address. It returns a boolean value indicating the success of the transfer.
* @dev * The transfer function takes in two parameters - the recipient's address and the amount of tokens to be transferred. It is an external function, meaning it can be called by other contracts or externally owned accounts.
* The function does not have any access restrictions, so anyone can call it as long as they have the necessary amount of tokens to transfer.
* Upon successful execution, the function will update the balances of the sender and recipient accordingly. It will also emit a Transfer event to notify any listeners of the transfer.
* If the transfer fails, either due to insufficient balance or other reasons, the function will return false.
* It is important to note that this function does not handle any fees or charges associated with the transfer. It is the responsibility of the caller to ensure that the necessary fees are included in the amount parameter.
* Overall, this function provides a simple and straightforward way to transfer tokens between addresses.
*/
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.
*/
/**
* @notice * This function allows users to view the amount of tokens that have been approved for transfer from one address to another. It does not actually transfer any tokens, but simply returns the allowance amount.
* @dev * The allowance function takes in two parameters, the owner address and the spender address. It then uses the view keyword to indicate that it is a read-only function and will not modify any state variables. The function returns a uint256 value, which represents the amount of tokens that have been approved for transfer from the owner address to the spender address.
* This function can be useful for implementing token transfer functionality in a smart contract. For example, a user may want to check the allowance amount before initiating a transfer to ensure that they have enough tokens approved for the transaction.
* It is important to note that this function does not actually transfer any tokens. It only returns the allowance amount and does not modify any state variables. Any token transfers must be done through the transfer or transferFrom functions.
* Overall, the allowance function provides a convenient way for users to check the amount of tokens that have been approved for transfer between two addresses.
*/
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.
*/
/**
* @notice * This function allows the contract owner to approve a specific address to spend a certain amount of tokens on their behalf. This function can only be called by the contract owner and is used to give permission to another address to transfer tokens from the owner's account.
* @dev * The function "approve" takes in two parameters: "spender" which is the address being approved and "amount" which is the number of tokens being approved for spending. This function is marked as "external" which means it can only be called from outside the contract.
* The function returns a boolean value indicating whether the approval was successful or not. This function can only be called by the contract owner, as specified by the "external" modifier. This ensures that only the owner has the ability to give permission for token transfers.
* Once the approval is granted, the approved address can then call the "transferFrom" function to transfer tokens from the owner's account. This allows for more flexibility in token transfers, as the owner does not have to manually initiate each transfer.
* It is important to note that the approved amount can be changed by calling this function again with a different amount. This allows the owner to update the approved amount as needed.
* Overall, the "approve" function is a crucial part of the token transfer process and provides a secure way for the contract owner to give permission for token transfers on their behalf.
*/
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.
*/
/**
* @notice * This function allows the transfer of a specified amount of tokens from the sender's address to the recipient's address. It is a part of the ERC-20 token standard and is used to transfer tokens between different addresses.
* @dev * The transferFrom function takes in three parameters - sender, recipient, and amount. The sender is the address from which the tokens will be transferred, while the recipient is the address that will receive the tokens. The amount parameter specifies the number of tokens to be transferred.
* This function can only be called by the owner of the tokens or an approved spender. The owner must have previously approved the spender to transfer tokens on their behalf using the approve function.
* Upon successful execution, this function will return a boolean value indicating whether the transfer was successful or not.
* It is important to note that this function can only transfer tokens that have been approved by the owner. If the amount exceeds the approved limit, the transfer will fail.
* This function is a crucial part of the ERC-20 token standard and is used in various token transactions, such as trading on exchanges or sending tokens to other addresses. It is important to ensure that the sender has enough tokens and has approved the spender before calling this function to avoid any errors.
* It is recommended to thoroughly test this function before deploying it to a live network to ensure its proper functionality. Additionally, proper error handling should be implemented to handle any potential errors that may occur during the execution of this function.
*/
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);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
/**
* @notice * This function is used to safely transfer ERC20 tokens from one address to another. It takes in the token contract address, the recipient address, and the amount of tokens to be transferred as parameters.
* @dev * The function first calls the _callOptionalReturn function, passing in the token contract address and the encoded data for the transfer function. This function is used to handle any errors that may occur during the transfer process.
* The transfer function is then called using the token contract's transfer selector and passing in the recipient address and the amount of tokens to be transferred.
* It is important to note that this function is internal, meaning it can only be called from within the contract it is defined in. This ensures that the transfer can only be initiated by the contract itself, providing an extra layer of security.
* Overall, this function is a safe and efficient way to transfer ERC20 tokens within a contract.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @notice * This function is used to transfer tokens from one address to another. It is an internal function, meaning it can only be called within the contract it is defined in.
* @dev * The function takes in four parameters:
* 1. IERC20 token: This is the token contract address of the token being transferred.
* 2. address from: This is the address from which the tokens will be transferred.
* 3. address to: This is the address to which the tokens will be transferred.
* 4. uint256 value: This is the amount of tokens to be transferred.
* The function uses the _callOptionalReturn function to call the transferFrom function of the token contract. This function takes in three parameters: from, to, and value. These parameters are encoded using the abi.encodeWithSelector function and passed as the data parameter in the _callOptionalReturn function.
* It is important to note that this function does not handle any errors that may occur during the token transfer. It is the responsibility of the calling function to handle any errors and revert the transaction if necessary.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
/**
* @notice * This function, safeApprove, is used to set or reset an allowance for a specific spender on a given token. It should only be called when setting an initial allowance or resetting it to zero. To increase or decrease the allowance, use the functions safeIncreaseAllowance and safeDecreaseAllowance.
* @dev * The function requires three parameters: the token contract address, the spender's address, and the value of the allowance. It checks if the value is either zero or if the current allowance for the spender is also zero. If neither of these conditions is met, the function will revert with an error message.
* The function then calls the _callOptionalReturn function, passing in the token contract and the encoded function call to approve the spender for the specified value. This function will handle any potential errors or return values from the token contract.
* It is important to note that this function should only be used for setting or resetting an allowance. To increase or decrease the allowance, use the safeIncreaseAllowance and safeDecreaseAllowance functions. This is to ensure that the allowance is not accidentally overwritten or set to an incorrect value.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @notice * This function is used to safely increase the allowance for a specific spender on a specific token. It takes in the token contract, the spender's address, and the amount to increase the allowance by as parameters.
* @dev * The function first calculates the new allowance by adding the current allowance for the spender to the value parameter. It then calls the _callOptionalReturn function, passing in the token contract and the encoded function call to approve the spender for the new allowance amount. This ensures that the allowance is increased safely and without any potential errors.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @notice * This function is used to safely decrease the allowance of a specific spender for a given token. It is an internal function and should not be called directly by external users.
* @dev * The function takes in three parameters: the token contract address, the spender's address, and the amount to decrease the allowance by. It first checks the current allowance of the contract for the spender and subtracts the given value from it. If the resulting allowance is below zero, an error message will be returned. Otherwise, the function will call the token's approve function with the updated allowance as the parameter. This ensures that the allowance is decreased safely without the risk of going below zero.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
/**
* @notice * This function is used to perform a low level call to bypass Solidity's return data size checking mechanism. It is important to note that this function should only be used by experienced developers as it involves low level calls and can be risky if not implemented correctly.
* @dev * The function takes in two parameters, an IERC20 token and a bytes memory data. It then uses the {Address.functionCall} to perform a low level call to the target address, which must contain contract code. The function also verifies that the call was successful using the "SafeERC20: low-level call failed" error message.
* If the return data from the call is not empty, the function decodes it using the abi.decode function and checks if the operation was successful. If the operation was not successful, the function will revert with the "SafeERC20: ERC20 operation did not succeed" error message.
* It is important for developers to thoroughly test and understand the implications of using this function before implementing it in their code. It should only be used when necessary and with caution.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
/**
* @notice * This function is used to check if the given address is a contract or not. It relies on the extcodesize method, which returns 0 for contracts that are still in the process of being created. This means that the code for the contract is not yet stored at the end of the constructor execution.
* @dev * The function takes in an address as a parameter and uses the assembly code to retrieve the size of the code at that address. If the size is greater than 0, it means that the address is a contract. Otherwise, it is not a contract.
* It is important to note that this function is not foolproof and may not accurately determine if an address is a contract in all cases. It is recommended to use additional checks and precautions when dealing with contracts.
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
/**
* @notice * This function is used to send a specified amount of Ether to a specified recipient address. It is an internal function, meaning it can only be called from within the contract itself.
* @dev * The function takes two parameters: a payable address for the recipient and a uint256 value for the amount of Ether to be sent. The recipient address must be payable, meaning it can receive Ether.
* Before sending the Ether, the function checks if the contract has enough balance to cover the specified amount. If there is not enough balance, the function will revert and the transaction will fail.
* The function then uses a low-level call to send the specified amount of Ether to the recipient address. This call is wrapped in a bool variable to check if the call was successful. If the call was not successful, the function will revert and the transaction will fail.
* It is important to note that this function does not have any access control, meaning anyone can call it and send Ether to any address. It is the responsibility of the contract developer to implement proper access control mechanisms to prevent unauthorized use of this function.
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
/**
* @notice * This function is used to call another function within a contract. It takes in the target address and the data to be passed as parameters. It also includes a default error message in case the call fails.
* @dev * The functionCall function is an internal function that is used to call another function within a contract. It takes in two parameters - the target address and the data to be passed to the function. The function then executes the call and returns the result as a bytes array. In case the call fails, it will return an error message stating "Address: low-level call failed". This function is commonly used in contract development to interact with other contracts and execute specific functions. It is important to note that this function should only be used within the contract and not externally, as it is marked as internal.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
/**
* @notice * This function is used to call another function with the specified target address and data. It also handles any error messages that may occur during the function call.
* @dev * The functionCall function is an internal function that is used to call another function with the specified target address and data. It also handles any error messages that may occur during the function call. It uses the functionCallWithValue function, passing in a value of 0, to make the function call. This function is typically used within other functions in the contract to call external functions. It is important to note that this function is only accessible within the contract and cannot be called externally.
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
/**
* @notice * This function is used to make a low-level call to a target address with a specified value. It is important to note that this function should only be used by experienced developers who understand the risks involved with low-level calls.
* @dev * The functionCallWithValue function takes in three parameters: the target address, the data to be passed in the call, and the value to be sent along with the call. It then returns the result of the call as a bytes array.
* It is important to note that this function should only be used for low-level calls, as it does not perform any safety checks. This means that the target address could potentially be a malicious contract, and the data and value could be manipulated to cause unexpected behavior.
* Additionally, the functionCallWithValue function has an internal modifier, meaning it can only be called from within the contract it is defined in. This is to prevent external contracts from calling this function and potentially causing unintended consequences.
* Developers should also be aware that this function has a default error message of "Address: low-level call with value failed" if the call fails. This can be changed by passing in a custom error message as the fourth parameter.
* In summary, the functionCallWithValue function should only be used by experienced developers who understand the risks involved with low-level calls and have thoroughly tested their code. It is important to carefully consider the target address, data, and value being passed in to avoid any potential vulnerabilities.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
/**
* @notice * This function is used to call a contract with a specified value and data. It checks if the contract has enough balance to make the call and if the target address is a contract. It then uses low-level call to execute the call and returns the result.
* @dev * The function takes in four parameters: the target address, the data to be passed, the value to be sent, and an error message in case the call fails. It first checks if the contract has enough balance to make the call and if the target address is a contract. It then uses low-level call to execute the call and returns the result. The function is internal, meaning it can only be called from within the contract.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
/**
* @notice * This function is used to perform a low-level static call to the specified target address with the given data. It is intended to be used for read-only operations and does not modify the state of the contract.
* @dev * The function takes in two parameters: the target address and the data to be passed to the target contract. It then uses the "functionStaticCall" function to perform the static call and returns the result as a bytes array.
* It is important to note that this function is marked as "internal", meaning it can only be called from within the contract or from contracts that inherit from it. This is to ensure that the function is not accessible to external contracts and can only be used internally.
* The function also includes a third parameter, which is a string that serves as an error message in case the static call fails. This is to provide more information in case of an error and aid in debugging.
* It is recommended to use this function for read-only operations as it does not modify the state of the contract. Modifying the state of the contract through a static call can lead to unexpected results and should be avoided.
* Overall, this function is a useful tool for performing low-level static calls in a secure and controlled manner.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
/**
* @notice * This function is used to make a static call to a contract at the specified address. It requires the target address to be a contract. The function will return the result of the call as a bytes array.
* @dev * The function first checks if the target address is a contract by using the isContract() function. If the target address is not a contract, the function will revert with the error message "Address: static call to non-contract".
* Next, the function uses the staticcall() function to make the call to the target contract with the specified data. The result of the call is stored in the returndata variable.
* Finally, the function uses the _verifyCallResult() function to verify the success of the call and return the result as a bytes array. If the call was not successful, the function will revert with the specified error message.
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
/**
* @notice * This function is used to perform a low-level delegate call to the specified target address with the given data. It is important to note that delegate calls are a low-level operation and should only be used by experienced developers who understand the potential risks and implications.
* @dev * The functionDelegateCall function takes in two parameters: the target address and the data to be passed to the delegate call. It then calls the functionDelegateCall function with an additional error message parameter, which will be returned if the delegate call fails.
* It is important to note that delegate calls can be used to execute code from another contract, which can be useful for creating modular and upgradable contracts. However, this also means that the code being executed is not under the control of the calling contract, so it is crucial to carefully review and trust the target contract before making a delegate call.
* Additionally, delegate calls do not have access to the calling contract's storage, so any state changes made during the delegate call will not be reflected in the calling contract. This can lead to unexpected behavior and should be taken into consideration when using delegate calls.
* In summary, the functionDelegateCall function should only be used by experienced developers who understand the potential risks and implications of delegate calls. It is important to carefully review and trust the target contract before making a delegate call, and to keep in mind that any state changes made during the delegate call will not be reflected in the calling contract.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
/**
* @notice * This function allows for delegate calls to be made to a contract address. It first checks that the target address is a contract, and then executes the delegate call with the provided data. It then verifies the result of the call and returns any error message if necessary.
* @dev * The function takes in three parameters: the target address, the data to be used in the delegate call, and an error message. It uses the internal function _verifyCallResult to check the success of the delegate call and return any error message if needed. It is important to note that this function should only be used with trusted contracts, as delegate calls can be used to execute code from external contracts. Careful consideration should be taken when using this function to ensure the security of the contract.
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* Notice: This function is used to verify the result of a call to an external contract. It takes in three parameters: a boolean indicating the success of the call, the return data from the call, and an error message if the call was unsuccessful.
* Dev: The function first checks if the call was successful. If it was, it simply returns the return data. If the call was unsuccessful, the function checks if there is a revert reason in the return data. If there is, it uses assembly to bubble up the revert reason. If there is no revert reason, the function reverts with the provided error message.
*/
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <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 GSN 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 {
/**
* @notice * This function is used to retrieve the address of the sender of the current transaction. It is an internal function, meaning it can only be called within the contract or its derived contracts.
* @dev * The _msgSender() function is defined as an internal, view and virtual function. This means that it can only be called within the contract or its derived contracts, it does not modify the state of the contract, and it can be overridden by derived contracts.
* This function returns an address payable, which is the address of the sender of the current transaction. This address can be used to identify the sender and perform actions based on their identity.
* It is important to note that this function is commonly used in access control mechanisms, where certain functions can only be executed by specific addresses. Therefore, it is crucial to properly implement and secure this function to prevent unauthorized access to sensitive functions within the contract.
*/
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
/**
* @notice * This function is used to return the data of the current message. It is an internal function and can only be called within the contract. It does not modify the state of the contract and does not generate any bytecode.
* @dev * The function "_msgData" is used to retrieve the data of the current message. It is an internal function, meaning it can only be called within the contract. It does not modify the state of the contract and does not generate any bytecode. This function is useful for accessing the data sent with a transaction, such as function parameters or additional information. It is important to note that this function does not validate the data, so it is the responsibility of the developer to ensure the data is valid before using it.
*/
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
interface ICurveGauge {
function deposit(uint256) external;
function balanceOf(address) external view returns (uint256);
function withdraw(uint256) external;
function claim_rewards() external;
function reward_tokens(uint256) external view returns(address);//v2
function rewarded_token() external view returns(address);//v1
function lp_token() external view returns(address);
}
interface ICurveVoteEscrow {
function create_lock(uint256, uint256) external;
function increase_amount(uint256) external;
function increase_unlock_time(uint256) external;
function withdraw() external;
function smart_wallet_checker() external view returns (address);
function commit_smart_wallet_checker(address) external;
function apply_smart_wallet_checker() external;
}
interface IWalletChecker {
function check(address) external view returns (bool);
function approveWallet(address) external;
function dao() external view returns (address);
}
interface IVoting{
function vote(uint256, bool, bool) external; //voteId, support, executeIfDecided
function getVote(uint256) external view returns(bool,bool,uint64,uint64,uint64,uint64,uint256,uint256,uint256,bytes memory);
function vote_for_gauge_weights(address,uint256) external;
}
interface IMinter{
function mint(address) external;
}
interface IStaker{
function deposit(address, address) external returns (bool);
function withdraw(address) external returns (uint256);
function withdraw(address, address, uint256) external returns (bool);
function withdrawAll(address, address) external returns (bool);
function createLock(uint256, uint256) external returns(bool);
function increaseAmount(uint256) external returns(bool);
function increaseTime(uint256) external returns(bool);
function release() external returns(bool);
function claimCrv(address) external returns (uint256);
function claimRewards(address) external returns(bool);
function claimFees(address) external returns (uint256);
function setStashAccess(address, bool) external returns (bool);
function vote(uint256,address,bool) external returns(bool);
function voteGaugeWeight(address,uint256) external returns(bool);
function balanceOfPool(address) external view returns (uint256);
function operator() external view returns (address);
function execute(address _to, uint256 _value, bytes calldata _data) external returns (bool, bytes memory);
function migrate(address to) external;
}
interface IRewards{
function stake(address, uint256) external;
function stakeFor(address, uint256) external;
function withdraw(address, uint256) external;
function exit(address) external;
function getReward(address) external;
function queueNewRewards(uint256) external;
function notifyRewardAmount(uint256) external;
function addExtraReward(address) external;
function extraRewardsLength() external view returns (uint256);
function stakingToken() external view returns (address);
function rewardToken() external view returns(address);
function earned(address account) external view returns (uint256);
}
interface IStash{
function stashRewards() external returns (bool);
function processStash() external returns (bool);
function claimRewards() external returns (bool);
function initialize(uint256 _pid, address _operator, address _staker, address _gauge, address _rewardFactory) external;
function setExtraReward(address) external;
}
interface IFeeDistributor {
function claim(address user) external returns (uint256);
function token() external view returns (address);
function toggle_allow_checkpoint_token() external;
function admin() external view returns (address);
}
interface ITokenMinter{
function mint(address,uint256) external;
function burn(address,uint256) external;
}
interface IDeposit{
function isShutdown() external view returns(bool);
function balanceOf(address _account) external view returns(uint256);
function totalSupply() external view returns(uint256);
function poolInfo(uint256) external view returns(address,address,address,address,address,bool);
function poolLength() external view returns(uint256);
function withdrawTo(uint256,uint256,address) external;
function claimRewards(uint256,address) external returns(bool);
function setGaugeRedirect(uint256 _pid) external returns(bool);
function owner() external returns(address);
function poolManager() external returns(address);
function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns(bool);
function crv() external returns (address);
function cvxCrv() external returns (address);
function lockRewards() external returns (address);
function stakerRewards() external returns (address);
function lockIncentive() external returns (uint256);
function stakerIncentive() external returns (uint256);
function earmarkIncentive() external returns (uint256);
}
interface ICrvDeposit{
function deposit(uint256, bool) external;
function lockIncentive() external view returns(uint256);
}
interface IRewardFactory{
function setAccess(address,bool) external;
function CreateCrvRewards(uint256,address,address) external returns(address);
function CreateTokenRewards(address,address,address) external returns(address);
function activeRewardCount(address) external view returns(uint256);
function addActiveReward(address,uint256) external returns(bool);
function removeActiveReward(address,uint256) external returns(bool);
}
interface IStashFactory{
function CreateStash(uint256,address,address) external returns(address);
function setImplementation(address) external;
}
interface ITokenFactory{
function CreateDepositToken(address) external returns(address);
}
interface IPools{
function addPool(address _lptoken, address _gauge) external returns(bool);
function shutdownPool(uint256 _pid) external returns(bool);
function poolInfo(uint256) external view returns(address,address,address,address,address,bool);
function poolLength() external view returns (uint256);
function gaugeMap(address) external view returns(bool);
function setPoolManager(address _poolM) external;
function shutdownSystem() external;
function setUsedAddress(address[] memory) external;
}
interface IVestedEscrow{
function fund(address[] calldata _recipient, uint256[] calldata _amount) external returns(bool);
}
interface IRewardDeposit {
function addReward(address, uint256) external;
}
interface IBoosterFeeDistro {
function queueNewRewards(uint256 _lockIncentive, uint256 _stakerIncentive, uint256 _callIncentive) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IAuraLocker {
function isShutdown() external view returns (bool);
function lock(address _account, uint256 _amount) external;
function checkpointEpoch() external;
function epochCount() external view returns (uint256);
function balanceAtEpochOf(uint256 _epoch, address _user) external view returns (uint256 amount);
function totalSupplyAtEpoch(uint256 _epoch) external view returns (uint256 supply);
function queueNewRewards(address _rewardsToken, uint256 reward) external;
function getReward(address _account, bool _stake) external;
function getReward(address _account) external;
}{
"metadata": {
"bytecodeHash": "none"
},
"optimizer": {
"enabled": true,
"runs": 800
},
"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":"_booster","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"lockIncentive","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakerIncentive","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"callIncentive","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"lockIncentive","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakerIncentive","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"callIncentive","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"auth","type":"bool"}],"name":"SetAuthorized","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authorized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"booster","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crv","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributeFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingCallIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingLockIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingStakerIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lockIncentive","type":"uint256"},{"internalType":"uint256","name":"_stakerIncentive","type":"uint256"},{"internalType":"uint256","name":"_callIncentive","type":"uint256"}],"name":"queueNewRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"auth","type":"bool"}],"name":"setAuthorized","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"skimmableIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakerRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101006040523480156200001257600080fd5b506040516200162b3803806200162b833981810160405260208110156200003857600080fd5b5051600062000046620002bf565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000816001600160a01b031663376d771a6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620000ce57600080fd5b505af1158015620000e3573d6000803e3d6000fd5b505050506040513d6020811015620000fa57600080fd5b505190506001600160a01b03811662000149576040805162461bcd60e51b815260206004820152600c60248201526b216c6f636b5265776172647360a01b604482015290519081900360640190fd5b816001600160a01b0316636a4874a16040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156200018557600080fd5b505af11580156200019a573d6000803e3d6000fd5b505050506040513d6020811015620001b157600080fd5b50516001600160601b0319606091821b811660805283821b811660a0529082901b1660c052604080516367dce7dd60e11b815290516001600160a01b0384169163cfb9cfba9160048083019260209291908290030181600087803b1580156200021957600080fd5b505af11580156200022e573d6000803e3d6000fd5b505050506040513d60208110156200024557600080fd5b505160601b6001600160601b03191660e0526001600160a01b0382166000818152600460209081526040918290208054600160ff19909116811790915582519384529083015280517f3a84b5fa7354b6140edebeacc19b3e5ef2d0168a26096f175e10c2622133bb8c9281900390910190a15050620002c3565b3390565b60805160601c60a05160601c60c05160601c60e05160601c6112e5620003466000398061081d528061087152806108985280610a0b52508061048e52806107b75250806102625280610307528061039a52806109e75250806104b85280610682528061079552806107fa528061084f52806108c7528061097952506112e56000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063968a1e3911610097578063c6def07611610066578063c6def076146101ed578063cfb9cfba146101f5578063e5bdfbbb146101fd578063f2fde38b1461022657610100565b8063968a1e391461019b5780639c089a14146101a3578063b9181611146101ab578063bb57ad20146101e557610100565b8063711bf9b2116100d3578063711bf9b214610155578063715018a614610183578063754f6aa11461018b5780638da5cb5b1461019357610100565b80631dd19cb414610105578063376d771a1461010f5780634ffbed31146101335780636a4874a11461014d575b600080fd5b61010d61024c565b005b61011761048c565b604080516001600160a01b039092168252519081900360200190f35b61013b6104b0565b60408051918252519081900360200190f35b6101176104b6565b61010d6004803603604081101561016b57600080fd5b506001600160a01b03813516906020013515156104da565b61010d6105b2565b61013b61067d565b61011761074a565b61013b610759565b61013b61075f565b6101d1600480360360208110156101c157600080fd5b50356001600160a01b0316610765565b604080519115158252519081900360200190f35b61010d61077a565b6101176109e5565b610117610a09565b61010d6004803603606081101561021357600080fd5b5080359060208101359060400135610a2d565b61010d6004803603602081101561023c57600080fd5b50356001600160a01b0316610b06565b600061025661067d565b905080156104895760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663509406186040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156102bb57600080fd5b505af11580156102cf573d6000803e3d6000fd5b505050506040513d60208110156102e557600080fd5b5051604080516362d28ac760e01b815290519192506000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916362d28ac791600480830192602092919082900301818787803b15801561034e57600080fd5b505af1158015610362573d6000803e3d6000fd5b505050506040513d602081101561037857600080fd5b505160408051631d04466960e11b815290519192506000916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691633a088cd291600480830192602092919082900301818787803b1580156103e157600080fd5b505af11580156103f5573d6000803e3d6000fd5b505050506040513d602081101561040b57600080fd5b5051905060006104258261041f8686610c27565b90610c27565b905061044761043e826104388888610c8a565b90610ce3565b60015490610c27565b60015561046461045b826104388887610c8a565b60025490610c27565b600255610481610478826104388886610c8a565b60035490610c27565b600355505050505b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6104e2610d4a565b6001600160a01b03166104f361074a565b6001600160a01b03161461054e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038216600081815260046020908152604091829020805460ff191685151590811790915582519384529083015280517f3a84b5fa7354b6140edebeacc19b3e5ef2d0168a26096f175e10c2622133bb8c9281900390910190a15050565b6105ba610d4a565b6001600160a01b03166105cb61074a565b6001600160a01b031614610626576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156106ed57600080fd5b505afa158015610701573d6000803e3d6000fd5b505050506040513d602081101561071757600080fd5b5051600354600254600154929350600092610737929161041f9190610c27565b90506107438282610d4e565b9250505090565b6000546001600160a01b031690565b60035481565b60025481565b60046020526000908152604090205460ff1681565b60015480156107dc5760006001556107dc6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083610dab565b60025480156109465760006002819055610842906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016907f000000000000000000000000000000000000000000000000000000000000000090610e17565b6108966001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083610e17565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166304d0c2c57f0000000000000000000000000000000000000000000000000000000000000000836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561092d57600080fd5b505af1158015610941573d6000803e3d6000fd5b505050505b6003548015801590610962575060008311806109625750600082115b156109a05760006003556109a06001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383610dab565b604080518481526020810184905280820183905290517fc5d35a65af09b3042394b742529d10f7fbf9a37294d6b13e4d63d06f9909a15b9181900360600190a1505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b3360009081526004602052604090205460ff16610a91576040805162461bcd60e51b815260206004820152600560248201527f2161757468000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154610a9e9084610c27565b600155600254610aae9083610c27565b600255600354610abe9082610c27565b600355604080518481526020810184905280820183905290517f9795f222c951ae3e749f872dbe287f78d21fa52353e9175cb20ed3aa2b29b82b9181900360600190a1505050565b610b0e610d4a565b6001600160a01b0316610b1f61074a565b6001600160a01b031614610b7a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610bbf5760405162461bcd60e51b815260040180806020018281038252602681526020018061120c6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600082820183811015610c81576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600082610c9957506000610c84565b82820282848281610ca657fe5b0414610c815760405162461bcd60e51b81526004018080602001828103825260218152602001806112586021913960400191505060405180910390fd5b6000808211610d39576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610d4257fe5b049392505050565b3390565b600082821115610da5576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610e12908490610f3b565b505050565b801580610e9d575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015610e6f57600080fd5b505afa158015610e83573d6000803e3d6000fd5b505050506040513d6020811015610e9957600080fd5b5051155b610ed85760405162461bcd60e51b81526004018080602001828103825260368152602001806112a36036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b179052610e129084905b6060610f90826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fec9092919063ffffffff16565b805190915015610e1257808060200190516020811015610faf57600080fd5b5051610e125760405162461bcd60e51b815260040180806020018281038252602a815260200180611279602a913960400191505060405180910390fd5b6060610ffb8484600085611005565b90505b9392505050565b6060824710156110465760405162461bcd60e51b81526004018080602001828103825260268152602001806112326026913960400191505060405180910390fd5b61104f85611161565b6110a0576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106110df5780518252601f1990920191602091820191016110c0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611141576040519150601f19603f3d011682016040523d82523d6000602084013e611146565b606091505b5091509150611156828286611167565b979650505050505050565b3b151590565b60608315611176575081610ffe565b8251156111865782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111d05781810151838201526020016111b8565b50505050905090810190601f1680156111fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a164736f6c634300060c000a00000000000000000000000008d46dc9e455c9b97e671b6291a54ba5668b94ac
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063968a1e3911610097578063c6def07611610066578063c6def076146101ed578063cfb9cfba146101f5578063e5bdfbbb146101fd578063f2fde38b1461022657610100565b8063968a1e391461019b5780639c089a14146101a3578063b9181611146101ab578063bb57ad20146101e557610100565b8063711bf9b2116100d3578063711bf9b214610155578063715018a614610183578063754f6aa11461018b5780638da5cb5b1461019357610100565b80631dd19cb414610105578063376d771a1461010f5780634ffbed31146101335780636a4874a11461014d575b600080fd5b61010d61024c565b005b61011761048c565b604080516001600160a01b039092168252519081900360200190f35b61013b6104b0565b60408051918252519081900360200190f35b6101176104b6565b61010d6004803603604081101561016b57600080fd5b506001600160a01b03813516906020013515156104da565b61010d6105b2565b61013b61067d565b61011761074a565b61013b610759565b61013b61075f565b6101d1600480360360208110156101c157600080fd5b50356001600160a01b0316610765565b604080519115158252519081900360200190f35b61010d61077a565b6101176109e5565b610117610a09565b61010d6004803603606081101561021357600080fd5b5080359060208101359060400135610a2d565b61010d6004803603602081101561023c57600080fd5b50356001600160a01b0316610b06565b600061025661067d565b905080156104895760007f00000000000000000000000008d46dc9e455c9b97e671b6291a54ba5668b94ac6001600160a01b031663509406186040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156102bb57600080fd5b505af11580156102cf573d6000803e3d6000fd5b505050506040513d60208110156102e557600080fd5b5051604080516362d28ac760e01b815290519192506000916001600160a01b037f00000000000000000000000008d46dc9e455c9b97e671b6291a54ba5668b94ac16916362d28ac791600480830192602092919082900301818787803b15801561034e57600080fd5b505af1158015610362573d6000803e3d6000fd5b505050506040513d602081101561037857600080fd5b505160408051631d04466960e11b815290519192506000916001600160a01b037f00000000000000000000000008d46dc9e455c9b97e671b6291a54ba5668b94ac1691633a088cd291600480830192602092919082900301818787803b1580156103e157600080fd5b505af11580156103f5573d6000803e3d6000fd5b505050506040513d602081101561040b57600080fd5b5051905060006104258261041f8686610c27565b90610c27565b905061044761043e826104388888610c8a565b90610ce3565b60015490610c27565b60015561046461045b826104388887610c8a565b60025490610c27565b600255610481610478826104388886610c8a565b60035490610c27565b600355505050505b50565b7f000000000000000000000000bc349c3d7cbfb3b7a9a5444ce66cb951ab367d0f81565b60015481565b7f000000000000000000000000e36072dd051ce26261bf50cd966311cab62c596e81565b6104e2610d4a565b6001600160a01b03166104f361074a565b6001600160a01b03161461054e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038216600081815260046020908152604091829020805460ff191685151590811790915582519384529083015280517f3a84b5fa7354b6140edebeacc19b3e5ef2d0168a26096f175e10c2622133bb8c9281900390910190a15050565b6105ba610d4a565b6001600160a01b03166105cb61074a565b6001600160a01b031614610626576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000807f000000000000000000000000e36072dd051ce26261bf50cd966311cab62c596e6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156106ed57600080fd5b505afa158015610701573d6000803e3d6000fd5b505050506040513d602081101561071757600080fd5b5051600354600254600154929350600092610737929161041f9190610c27565b90506107438282610d4e565b9250505090565b6000546001600160a01b031690565b60035481565b60025481565b60046020526000908152604090205460ff1681565b60015480156107dc5760006001556107dc6001600160a01b037f000000000000000000000000e36072dd051ce26261bf50cd966311cab62c596e167f000000000000000000000000bc349c3d7cbfb3b7a9a5444ce66cb951ab367d0f83610dab565b60025480156109465760006002819055610842906001600160a01b037f000000000000000000000000e36072dd051ce26261bf50cd966311cab62c596e16907f000000000000000000000000c1de2d060a18cffab121e90118e380629d11977e90610e17565b6108966001600160a01b037f000000000000000000000000e36072dd051ce26261bf50cd966311cab62c596e167f000000000000000000000000c1de2d060a18cffab121e90118e380629d11977e83610e17565b7f000000000000000000000000c1de2d060a18cffab121e90118e380629d11977e6001600160a01b03166304d0c2c57f000000000000000000000000e36072dd051ce26261bf50cd966311cab62c596e836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561092d57600080fd5b505af1158015610941573d6000803e3d6000fd5b505050505b6003548015801590610962575060008311806109625750600082115b156109a05760006003556109a06001600160a01b037f000000000000000000000000e36072dd051ce26261bf50cd966311cab62c596e163383610dab565b604080518481526020810184905280820183905290517fc5d35a65af09b3042394b742529d10f7fbf9a37294d6b13e4d63d06f9909a15b9181900360600190a1505050565b7f00000000000000000000000008d46dc9e455c9b97e671b6291a54ba5668b94ac81565b7f000000000000000000000000c1de2d060a18cffab121e90118e380629d11977e81565b3360009081526004602052604090205460ff16610a91576040805162461bcd60e51b815260206004820152600560248201527f2161757468000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154610a9e9084610c27565b600155600254610aae9083610c27565b600255600354610abe9082610c27565b600355604080518481526020810184905280820183905290517f9795f222c951ae3e749f872dbe287f78d21fa52353e9175cb20ed3aa2b29b82b9181900360600190a1505050565b610b0e610d4a565b6001600160a01b0316610b1f61074a565b6001600160a01b031614610b7a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610bbf5760405162461bcd60e51b815260040180806020018281038252602681526020018061120c6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600082820183811015610c81576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600082610c9957506000610c84565b82820282848281610ca657fe5b0414610c815760405162461bcd60e51b81526004018080602001828103825260218152602001806112586021913960400191505060405180910390fd5b6000808211610d39576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610d4257fe5b049392505050565b3390565b600082821115610da5576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610e12908490610f3b565b505050565b801580610e9d575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015610e6f57600080fd5b505afa158015610e83573d6000803e3d6000fd5b505050506040513d6020811015610e9957600080fd5b5051155b610ed85760405162461bcd60e51b81526004018080602001828103825260368152602001806112a36036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b179052610e129084905b6060610f90826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fec9092919063ffffffff16565b805190915015610e1257808060200190516020811015610faf57600080fd5b5051610e125760405162461bcd60e51b815260040180806020018281038252602a815260200180611279602a913960400191505060405180910390fd5b6060610ffb8484600085611005565b90505b9392505050565b6060824710156110465760405162461bcd60e51b81526004018080602001828103825260268152602001806112326026913960400191505060405180910390fd5b61104f85611161565b6110a0576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106110df5780518252601f1990920191602091820191016110c0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611141576040519150601f19603f3d011682016040523d82523d6000602084013e611146565b606091505b5091509150611156828286611167565b979650505050505050565b3b151590565b60608315611176575081610ffe565b8251156111865782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111d05781810151838201526020016111b8565b50505050905090810190601f1680156111fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a164736f6c634300060c000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000008d46dc9e455c9b97e671b6291a54ba5668b94ac
-----Decoded View---------------
Arg [0] : _booster (address): 0x08d46dC9E455c9B97E671b6291a54ba5668B94AC
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000008d46dc9e455c9b97e671b6291a54ba5668b94ac
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.