Contract Overview
Balance:
0 AVAX
AVAX Value:
$0.00
My Name Tag:
Not Available, login to update
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0x4f8d08a429e01e46a46c55b2d7447b2d07adf0255acb895feca54c9f600be9a9 | 0x6124c061 | 16417259 | 6 days 19 hrs ago | 0xdd5cf30f56c37d3243a23543dc5bd5ee576970e2 | IN | Create: PoolHelperJoeFactoryLib | 0 AVAX | 0.0586347174 |
[ Download CSV Export ]
Contract Name:
PoolHelperJoeFactoryLib
Compiler Version
v0.8.7+commit.e28d00a7
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC20.sol"; import "Initializable.sol"; import "OwnableUpgradeable.sol"; import "IJoeStaking.sol"; import "IBaseRewardPool.sol"; import "IPoolHelper.sol"; import "IMintableERC20.sol"; import "IMasterChefVTX.sol"; import "IxJoe.sol"; import "IMasterJoe.sol"; import "IWavax.sol"; import "PoolHelperJoeFactoryLib.sol"; import "ERC20FactoryLib.sol"; /// @title MainStaking /// @author Vector Team /// @notice Mainstaking is the contract that interacts with ALL Joe contract /// @dev all functions except harvest are restricted either to owner or to other contracts from the vector protocol /// @dev the owner of this contract holds a lot of power, and should be owned by a multisig contract MainStakingJoe is Initializable, OwnableUpgradeable { using SafeERC20 for IERC20; // Addresses address public stakingJoe; address public joe; address public xJoe; address public veJoe; address public masterJoe; address public masterVtx; address public router; // Fees uint256 constant FEE_DENOMINATOR = 10000; uint256 public constant MAX_FEE = 3000; uint256 public CALLER_FEE; uint256 public constant MAX_CALLER_FEE = 500; uint256 public totalFee; struct Fees { uint256 maxValue; uint256 minValue; uint256 value; address to; bool isJoe; bool isAddress; bool isActive; } Fees[] public feeInfos; struct Pool { uint256 pid; bool isActive; address token; address receiptToken; address rewarder; address helper; } mapping(address => Pool) public pools; mapping(address => address) public tokenToAvaxPool; bool public boostBufferActivated; bool public bypassBoostWait; mapping(address => address[]) public assetToBonusRewards; address public constant WAVAX = 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7; event AddFee(address to, uint256 value, bool isJoe, bool isAddress); event SetFee(address to, uint256 value); event RemoveFee(address to); event veJoeClaimed(uint256 amount); event JoeHarvested(uint256 amount, uint256 callerFee); event RewardPaidTo(address to, address rewardToken, uint256 feeAmount); event NewJoeStaked(uint256 amount); event PoolAdded(address tokenAddress); event PoolRemoved(address _token); event PoolHelperSet(address _token); event PoolRewarderSet(address token, address _poolRewarder); event MasterChiefSet(address _token); event MasterJoeSet(address _token); function __MainStakingJoe_init( address _joe, address _boostedMasterChefJoe, address _masterVtx, address _veJoe, address _router, address _stakingJoe, uint256 _callerFee ) public initializer { __Ownable_init(); // Address of the joe Token joe = _joe; // Address of the MasterChefJoe for depositing lp tokens masterJoe = _boostedMasterChefJoe; masterVtx = _masterVtx; CALLER_FEE = _callerFee; totalFee = _callerFee; veJoe = _veJoe; router = _router; stakingJoe = _stakingJoe; } /// @notice set the vJoe address /// @dev can only be called once /// @param _xJoe the vJoe address function setXJoe(address _xJoe) external onlyOwner { require(xJoe == address(0), "xJoe already set"); xJoe = _xJoe; } function boosterThreshold() public view returns (uint256) { return IJoeStaking(stakingJoe).speedUpThreshold(); } /// @notice This function adds a fee to the vector protocol /// @dev the value of the fee must match the max fee requirement /// @param max the maximum value for that fee /// @param min the minimum value for that fee /// @param value the initial value for that fee /// @param to the address or contract that receives the fee /// @param isJoe true if the fee is sent as Joe, otherwise it will be xJoe /// @param isAddress true if the receiver is an address, otherwise it's a BaseRewarder function addFee( uint256 max, uint256 min, uint256 value, address to, bool isJoe, bool isAddress ) external onlyOwner { require(to != address(0), "No fees to address 0"); require(totalFee + value <= MAX_FEE, "Max fee reached"); require(min <= value && value <= max, "Value not in range"); feeInfos.push( Fees({ maxValue: max, minValue: min, value: value, to: to, isJoe: isJoe, isAddress: isAddress, isActive: true }) ); totalFee += value; emit AddFee(to, value, isJoe, isAddress); } function setBufferStatus(bool status) public onlyOwner { boostBufferActivated = status; } function setBypassBoostWait(bool status) public onlyOwner { bypassBoostWait = status; } /// @notice change the value of some fee /// @dev the value must be between the min and the max specified when registering the fee /// @dev the value must match the max fee requirements /// @param index the index of the fee in the fee list /// @param value the new value of the fee function setFee(uint256 index, uint256 value) external onlyOwner { Fees storage fee = feeInfos[index]; require(fee.isActive, "Cannot change an deactivated fee"); require(fee.minValue <= value && value <= fee.maxValue, "Value not in range"); require(totalFee + value - fee.value <= MAX_FEE, "Max fee reached"); totalFee = totalFee - fee.value + value; fee.value = value; emit SetFee(fee.to, value); } /// @notice remove some fee /// @param index the index of the fee in the fee list function removeFee(uint256 index) external onlyOwner { Fees storage fee = feeInfos[index]; totalFee -= fee.value; fee.isActive = false; emit RemoveFee(fee.to); } /// @notice set the caller fee /// @param value the value of the caller fee function setCallerFee(uint256 value) external onlyOwner { require(value <= MAX_CALLER_FEE, "Value too high"); // Check if the fee delta does not make the total fee go over the limit totalFee = totalFee + value - CALLER_FEE; require(totalFee <= MAX_FEE, "MAX Fee reached"); CALLER_FEE = value; } /// @notice deposit lp in a Joe pool /// @dev this function can only be called by a PoolHelper /// @param token the token to deposit /// @param amount the amount to deposit function deposit(address token, uint256 amount) external { // Get information of the pool of the token Pool storage poolInfo = pools[token]; //Requirements require(poolInfo.isActive, "Pool not active"); require(msg.sender == poolInfo.helper, "Only helper can deposit"); IERC20(token).safeTransferFrom(poolInfo.helper, address(this), amount); // Deposit to masterJoe Contract _approveTokenIfNeeded(token, masterJoe, amount); IMasterJoe(masterJoe).deposit(poolInfo.pid, amount); IMintableERC20(poolInfo.receiptToken).mint(poolInfo.helper, amount); } /// @notice harvest a pool from MasterJoe /// @param token the address of the token to harvest /// @param isUser true if this function is not called by the vector Contracts. The caller gets the caller fee function harvest(address token, bool isUser) public { Pool storage poolInfo = pools[token]; require(poolInfo.isActive, "Pool not active"); address[] memory bonusTokens = assetToBonusRewards[token]; uint256 bonusTokensLength = bonusTokens.length; uint256[] memory beforeBalances = new uint256[](bonusTokensLength); for (uint256 i; i < bonusTokensLength; i++) { beforeBalances[i] = IERC20(bonusTokens[i]).balanceOf(address(this)); } uint256 beforeBalance = IERC20(joe).balanceOf(address(this)); IMasterJoe(masterJoe).deposit(poolInfo.pid, 0); uint256 rewards = IERC20(joe).balanceOf(address(this)) - beforeBalance; uint256 afterFee = rewards; if (isUser && CALLER_FEE != 0) { uint256 feeAmount = (rewards * CALLER_FEE) / FEE_DENOMINATOR; _approveTokenIfNeeded(joe, xJoe, feeAmount); IxJoe(xJoe).depositFor(feeAmount, msg.sender); afterFee = afterFee - feeAmount; } sendRewards(poolInfo.token, poolInfo.rewarder, rewards, afterFee); for (uint256 i; i < bonusTokensLength; i++) { uint256 bonusBalanceDiff = IERC20(bonusTokens[i]).balanceOf(address(this)) - beforeBalances[i]; if (bonusBalanceDiff > 0) { sendOtherRewards(bonusTokens[i], poolInfo.rewarder, bonusBalanceDiff); } } emit JoeHarvested(rewards, rewards - afterFee); } /// @notice Send bonus rewards to the rewarders, don't apply platform fees /// @param token the address of the token to send rewards to /// @param rewarder the rewarder that will get tthe rewards /// @param _amount the initial amount of rewards after harvest function sendOtherRewards( address token, address rewarder, uint256 _amount ) internal { IERC20(token).approve(rewarder, _amount); IBaseRewardPool(rewarder).queueNewRewards(_amount, token); emit RewardPaidTo(rewarder, token, _amount); } /// @notice increase allowance to a contract to the maximum amount for a specific token if it is needed /// @param token the token to increase the allowance of /// @param _to the contract to increase the allowance /// @param _amount the amount of allowance that the contract needs function _approveTokenIfNeeded( address token, address _to, uint256 _amount ) private { if (IERC20(token).allowance(address(this), _to) < _amount) { IERC20(token).approve(_to, type(uint256).max); } } /// @notice Send rewards to the rewarders /// @param token the address of the token to send rewards to /// @param rewarder the rewarder that will get the rewards /// @param _amount the initial amount of rewards after harvest /// @param afterFee the amount to send to the rewarder after fees are collected function sendRewards( address token, address rewarder, uint256 _amount, uint256 afterFee ) internal { for (uint256 i = 0; i < feeInfos.length; i++) { Fees storage feeInfo = feeInfos[i]; if (feeInfo.isActive) { address rewardToken = joe; uint256 feeAmount = (_amount * feeInfo.value) / FEE_DENOMINATOR; if (!feeInfo.isJoe) { // _approveTokenIfNeeded(joe, xJoe, feeAmount); IxJoe(xJoe).depositWithoutTransferFor(feeAmount, address(this)); rewardToken = xJoe; } if (!feeInfo.isAddress) { _approveTokenIfNeeded(rewardToken, feeInfo.to, feeAmount); IBaseRewardPool(feeInfo.to).donateRewards(feeAmount, rewardToken); } else { IERC20(rewardToken).transfer(feeInfo.to, feeAmount); emit RewardPaidTo(feeInfo.to, rewardToken, feeAmount); } afterFee -= feeAmount; } } _approveTokenIfNeeded(joe, rewarder, afterFee); IBaseRewardPool(rewarder).queueNewRewards(afterFee, joe); } /// @notice Send Unusual rewards to the rewarders, as airdrops /// @dev fees are not collected /// @param _token the address of the token to send /// @param _rewarder the rewarder that will get the rewards function sendTokenRewards(address _token, address _rewarder) external onlyOwner { // require(_token != joe, "not authorized"); // require(!pools[_token].isActive, "Not authorized"); uint256 amount = IERC20(_token).balanceOf(address(this)); _approveTokenIfNeeded(_token, _rewarder, amount); IBaseRewardPool(_rewarder).queueNewRewards(amount, _token); } /// @notice Send Unusual rewards to the rewarders, as airdrops /// @dev fees are not collected /// @param _token the address of the token to send /// @param _rewarder the rewarder that will get the rewards function donateTokenRewards(address _token, address _rewarder) external onlyOwner { // require(_token != joe, "not authorized"); // require(!pools[_token].isActive, "Not authorized"); uint256 amount = IERC20(_token).balanceOf(address(this)); _approveTokenIfNeeded(_token, _rewarder, amount); IBaseRewardPool(_rewarder).donateRewards(amount, _token); } /// @notice withdraw from a Joe pool /// @dev Only a PoolHelper can call this function /// @param token the address of the pool token from which to withdraw /// @param _amount the initial amount of tokens to withdraw function withdraw(address token, uint256 _amount) external { // _amount is the amount of stable Pool storage poolInfo = pools[token]; require(msg.sender == poolInfo.helper, "Only helper can withdraw"); IMintableERC20(poolInfo.receiptToken).burn(msg.sender, _amount); IMasterJoe(masterJoe).withdraw(poolInfo.pid, _amount); IERC20(token).safeTransfer(poolInfo.helper, _amount); } function stakeJoeOwner(uint256 _amount) external onlyOwner { _stakeJoe(_amount); } function boostEndDate() public view returns (uint256 date) { (, , , date) = IJoeStaking(stakingJoe).userInfos(address(this)); } function joeBalance() public view returns (uint256) { return IERC20(joe).balanceOf(address(this)); } function remainingForBoost() public view returns (uint256) { uint256 stakedJoe = getStakedJoe(); uint256 balance = joeBalance(); uint256 threshold = (stakedJoe * boosterThreshold()) / 100; if (balance >= threshold + 1 ether) { return 0; } return threshold + 1 ether - balance; } function stakeJoe(uint256 _amount) public { uint256 amount = _amount; if (boostBufferActivated == false) { _stakeJoe(amount); return; } uint256 neededForBoost = remainingForBoost(); if (neededForBoost == 0) { uint256 balance = joeBalance(); if ((block.timestamp > boostEndDate()) || bypassBoostWait) { _stakeJoe(balance); } else { uint256 stakedJoe = getStakedJoe(); uint256 threshold = (stakedJoe * boosterThreshold()) / 100; _stakeJoe(((balance - threshold) * (100 - boosterThreshold())) / 100); } } else { claimVeJoe(); } } /// @notice stake Joe /// @param amount the number of Joe to stake /// @dev the Joe must already be in the contract function _stakeJoe(uint256 amount) internal { if (amount > 0) { uint256 veJoeAmount = getPendingVeJoe(); _approveTokenIfNeeded(joe, stakingJoe, amount); IJoeStaking(stakingJoe).deposit(amount); emit veJoeClaimed(veJoeAmount); } emit NewJoeStaked(amount); } /// @notice Claim the pending veJoe function claimVeJoe() public { uint256 amount = getPendingVeJoe(); if (amount > 0) { IJoeStaking(stakingJoe).claim(); } emit veJoeClaimed(amount); } /// @notice gets the pending veJoe function getPendingVeJoe() public view returns (uint256 pending) { pending = IJoeStaking(stakingJoe).getPendingVeJoe(address(this)); } /// @notice gets the number of staked Joe by this contract function getStakedJoe() public view returns (uint256 stakedJoe) { (stakedJoe, , , ) = IJoeStaking(stakingJoe).userInfos(address(this)); } /// @notice get the number of veJoe of this contract function getVeJoe() external view returns (uint256) { return IERC20(veJoe).balanceOf(address(this)); } /// @notice Register a new pool of Joe /// @dev this function will deploy a new PoolHelper, and add the pool to the masterVTX /// @param _pid the pid of the pool /// @param _token the token to stake in the pool /// @param receiptName the name of the receipt Token /// @param receiptSymbol the symbol of the receipt Token /// @param allocPoints the weight of the VTX allocation function registerPool( uint256 _pid, address _token, string memory receiptName, string memory receiptSymbol, uint256 allocPoints ) external onlyOwner { require(pools[_token].isActive == false, "Pool is already registered and active"); IERC20 newToken = IERC20(ERC20FactoryLib.createERC20(receiptName, receiptSymbol)); address rewarder = IMasterChefVTX(masterVtx).createRewarder( address(newToken), address(joe) ); IPoolHelper helper = IPoolHelper( PoolHelperJoeFactoryLib.createPoolHelper( _pid, address(newToken), address(_token), address(this), address(masterVtx), address(rewarder), address(xJoe), router ) ); IMasterChefVTX(masterVtx).add( allocPoints, address(newToken), address(rewarder), address(helper) ); pools[_token] = Pool({ pid: _pid, isActive: true, token: _token, receiptToken: address(newToken), rewarder: address(rewarder), helper: address(helper) }); emit PoolAdded(_token); } /// @notice Get the information of a pool /// @param _address the address of the deposit token to fetch information for /// @return pid the pid of the pool /// @return isActive true if the pool is active /// @return token the deposit Token /// @return receipt - the address of the receipt token of this pool /// @return rewardsAddr the address of the rewarder /// @return helper the address of the poolHelper function getPoolInfo(address _address) external view returns ( uint256 pid, bool isActive, address token, address receipt, address rewardsAddr, address helper ) { Pool storage tokenInfo = pools[_address]; pid = tokenInfo.pid; isActive = tokenInfo.isActive; token = tokenInfo.token; receipt = tokenInfo.receiptToken; rewardsAddr = tokenInfo.rewarder; helper = tokenInfo.helper; } function removePool(address token) external onlyOwner { pools[token].isActive = false; emit PoolRemoved(token); } function setPoolHelper(address token, address _poolhelper) external onlyOwner { Pool storage poolInfo = pools[token]; poolInfo.helper = _poolhelper; emit PoolHelperSet(token); } function setPoolRewarder(address token, address _poolRewarder) external onlyOwner { Pool storage poolInfo = pools[token]; poolInfo.rewarder = _poolRewarder; emit PoolRewarderSet(token, _poolRewarder); } function setMasterChief(address _masterVtx) external onlyOwner { masterVtx = _masterVtx; emit MasterChiefSet(_masterVtx); } function setMasterJoe(address _masterJoe) external onlyOwner { masterJoe = _masterJoe; emit MasterJoeSet(_masterJoe); } function addBonusRewardForAsset(address _asset, address _bonusToken) external onlyOwner { assetToBonusRewards[_asset].push(_bonusToken); } receive() external payable { IWAVAX(WAVAX).deposit{value: address(this).balance}(); } uint256[40] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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 * ==== */ 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; 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]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (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._ */ 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._ */ 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._ */ 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._ */ 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"); (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._ */ 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._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "ContextUpgradeable.sol"; import "Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { __Context_init_unchained(); } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IJoeStaking { function deposit(uint256 _amount) external; function withdraw(uint256 _amount) external; function claim() external; function getPendingVeJoe(address _user) external view returns (uint256); function userInfos(address _user) external view returns ( uint256, uint256, uint256, uint256 ); function speedUpThreshold() external view returns(uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IBaseRewardPool { struct Reward { address rewardToken; uint256 rewardPerTokenStored; uint256 queuedRewards; uint256 historicalRewards; } function rewards(address token) external view returns (Reward memory rewardInfo); function rewardTokens() external view returns (address[] memory); function getStakingToken() external view returns (address); function getReward(address _account) external returns (bool); function rewardDecimals(address token) external view returns (uint256); function stakingDecimals() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function rewardPerToken(address token) external view returns (uint256); function updateFor(address account) external; function earned(address account, address token) external view returns (uint256); function stakeFor(address _for, uint256 _amount) external returns (bool); function withdrawFor( address user, uint256 amount, bool claim ) external; function queueNewRewards(uint256 _rewards, address token) external returns (bool); function donateRewards(uint256 _amountReward, address _rewardToken) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IPoolHelper { function totalSupply() external view returns (uint256); function balance(address _address) external view returns (uint256); function depositTokenBalance() external view returns (uint256); function rewardPerToken() external view returns (uint256); function harvest() external; function update() external; function earned() external view returns (uint256 vtxAmount, uint256 ptpAmount); function deposit(uint256 amount) external; function stake(uint256 amount) external; function withdraw(uint256 amount, uint256 minimumAmount) external; function getReward() external; function pendingPTP() external view returns (uint256 pendingTokens); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IMintableERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); function symbol() external view returns (string memory); function decimals() external view returns (uint8); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); function mint(address, uint256) external; function faucet(uint256) external; function burn(address, uint256) external; /** * @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.8.0; interface IMasterChefVTX { function poolLength() external view returns (uint256); function setPoolManagerStatus(address _address, bool _bool) external; function add( uint256 _allocPoint, address _lpToken, address _rewarder, address _helper ) external; function set( address _lp, uint256 _allocPoint, address _rewarder, address _locker, bool overwrite ) external; function createRewarder(address _lpToken, address mainRewardToken) external returns (address); // View function to see pending VTXs on frontend. function getPoolInfo(address token) external view returns ( uint256 emission, uint256 allocpoint, uint256 sizeOfPool, uint256 totalPoint ); function pendingTokens( address _lp, address _user, address token ) external view returns ( uint256 pendingVTX, address bonusTokenAddress, string memory bonusTokenSymbol, uint256 pendingBonusToken ); function rewarderBonusTokenInfo(address _lp) external view returns (address bonusTokenAddress, string memory bonusTokenSymbol); function massUpdatePools() external; function updatePool(address _lp) external; function deposit(address _lp, uint256 _amount) external; function depositFor( address _lp, uint256 _amount, address sender ) external; function lock( address _lp, uint256 _amount, uint256 _index, bool force ) external; function unlock( address _lp, uint256 _amount, uint256 _index ) external; function multiUnlock( address _lp, uint256[] calldata _amount, uint256[] calldata _index ) external; function withdraw(address _lp, uint256 _amount) external; function withdrawFor( address _lp, uint256 _amount, address _sender ) external; function multiclaim(address[] memory _lps, address user_address) external; function emergencyWithdraw(address _lp, address sender) external; function updateEmissionRate(uint256 _vtxPerSec) external; function depositInfo(address _lp, address _user) external view returns (uint256 depositAmount); function setPoolHelper( address _lp, address _helper ) external; function authorizeLocker(address _locker) external; function lockFor( address _lp, uint256 _amount, uint256 _index, address _for, bool force ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IxJoe { function mainContract() external view returns (address); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function symbol() external view returns (string memory); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function depositFor(uint256 amount, address to) external; function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); function depositWithoutTransferFor(uint256 _amount, address _for) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IMasterJoe { function deposit(uint256 _pid, uint256 amount) external; function withdraw(uint256 _pid, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.5.0; interface IWAVAX { function deposit() external payable; function transfer(address to, uint256 value) external returns (bool); function withdraw(uint256) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "poolHelperJoe.sol"; library PoolHelperJoeFactoryLib { function createPoolHelper( uint256 _pid, address _stakingToken, address _depositToken, address _mainStaking, address _masterVtx, address _rewarder, address _xjoe, address _router ) public returns (address) { PoolHelperJoe pool = new PoolHelperJoe( _pid, _stakingToken, _depositToken, _mainStaking, _masterVtx, _rewarder, _xjoe, _router ); return address(pool); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "SafeERC20.sol"; import "IBaseRewardPool.sol"; import "IMainStakingJoe.sol"; import "IMasterChefVTX.sol"; import "IJoeRouter02.sol"; import "IJoePair.sol"; import "IWavax.sol"; /// @title Poolhelper /// @author Vector Team /// @notice This contract is the main contract that user will intreact with in order to stake stable in Vector protocol contract PoolHelperJoe { using SafeERC20 for IERC20; address public depositToken; address public constant wavax = 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7; address public immutable stakingToken; address public immutable xJoe; address public immutable masterVtx; address public immutable joeRouter; address public immutable mainStakingJoe; address public immutable rewarder; uint256 public immutable pid; bool public immutable isWavaxPool; address public tokenA; address public tokenB; uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status = 1; event NewDeposit(address indexed user, uint256 amount); event NewWithdraw(address indexed user, uint256 amount); constructor( uint256 _pid, address _stakingToken, address _depositToken, address _mainStakingJoe, address _masterVtx, address _rewarder, address _xJoe, address _joeRouter ) { pid = _pid; stakingToken = _stakingToken; depositToken = _depositToken; mainStakingJoe = _mainStakingJoe; masterVtx = _masterVtx; rewarder = _rewarder; xJoe = _xJoe; tokenA = IJoePair(depositToken).token0(); tokenB = IJoePair(depositToken).token1(); isWavaxPool = (tokenA == wavax || tokenB == wavax); joeRouter = _joeRouter; } modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } function totalSupply() public view returns (uint256) { return IBaseRewardPool(rewarder).totalSupply(); } /// @notice get the amount of reward per token deposited by a user /// @param token the token to get the number of rewards /// @return the amount of claimable tokens function rewardPerToken(address token) public view returns (uint256) { return IBaseRewardPool(rewarder).rewardPerToken(token); } /// @notice get the total amount of shares of a user /// @param _address the user /// @return the amount of shares function balanceOf(address _address) public view returns (uint256) { return IBaseRewardPool(rewarder).balanceOf(_address); } modifier _harvest() { IMainStakingJoe(mainStakingJoe).harvest(depositToken, false); _; } /// @notice harvest pending Joe and get the caller fee function harvest() public { IMainStakingJoe(mainStakingJoe).harvest(depositToken, true); IERC20(xJoe).safeTransfer(msg.sender, IERC20(xJoe).balanceOf(address(this))); } /// @notice get the total amount of rewards for a given token for a user /// @param token the address of the token to get the number of rewards for /// @return vtxAmount the amount of VTX ready for harvest /// @return tokenAmount the amount of token inputted function earned(address token) public view returns (uint256 vtxAmount, uint256 tokenAmount) { (vtxAmount, , , tokenAmount) = IMasterChefVTX(masterVtx).pendingTokens( stakingToken, msg.sender, token ); } /// @notice stake the receipt token in the masterchief of VTX on behalf of the caller function _stake(uint256 _amount) internal { _approveTokenIfNeeded(stakingToken, masterVtx, _amount); IMasterChefVTX(masterVtx).depositFor(stakingToken, _amount, msg.sender); } /// @notice unstake from the masterchief of VTX on behalf of the caller function _unstake(uint256 _amount) internal { IMasterChefVTX(masterVtx).withdrawFor(stakingToken, _amount, msg.sender); } function _deposit(uint256 _amount) internal { _approveTokenIfNeeded(depositToken, mainStakingJoe, _amount); IMainStakingJoe(mainStakingJoe).deposit(depositToken, _amount); } /// @notice deposit lp in mainStakingJoe, autostake in masterchief of VTX /// @dev performs a harvest of Joe just before depositing /// @param amount the amount of lp tokens to deposit function deposit(uint256 amount) external _harvest { IERC20(depositToken).safeTransferFrom(msg.sender, address(this), amount); _deposit(amount); _stake(amount); emit NewDeposit(msg.sender, amount); } /// @notice increase allowance to a contract to the maximum amount for a specific token if it is needed /// @param token the token to increase the allowance of /// @param _to the contract to increase the allowance /// @param _amount the amount of allowance that the contract needs function _approveTokenIfNeeded( address token, address _to, uint256 _amount ) private { if (IERC20(token).allowance(address(this), _to) < _amount) { IERC20(token).approve(_to, type(uint256).max); } } /// @notice convert tokens to lp tokens /// @param amountA amount of the first token we want to convert /// @param amountB amount of the second token we want to convert /// @param amountAMin minimum amount of the first token we want to convert /// @param amountBMin minimum amount of the second token we want to convert /// @return amountAConverted amount of the first token converted during the operation of adding liquidity to the pool /// @return amountBConverted amount of the second token converted during the operation of adding liquidity to the pool /// @return liquidity amount of lp tokens minted during the operation of adding liquidity to the pool function _createLPTokens( uint256 amountA, uint256 amountB, uint256 amountAMin, uint256 amountBMin ) internal returns ( uint256 amountAConverted, uint256 amountBConverted, uint256 liquidity ) { _approveTokenIfNeeded(tokenA, joeRouter, amountA); _approveTokenIfNeeded(tokenB, joeRouter, amountB); (amountAConverted, amountBConverted, liquidity) = IJoeRouter01(joeRouter).addLiquidity( tokenA, tokenB, amountA, amountB, amountAMin, amountBMin, address(this), block.timestamp ); } /// @notice Add liquidity and then deposits lp in mainStakingJoe, autostake in masterchief of VTX /// @dev performs a harvest of Joe just before depositing /// @param amountA the desired amount of token A to deposit /// @param amountB the desired amount of token B to deposit /// @param amountAMin the minimum amount of token B to get back /// @param amountBMin the minimum amount of token B to get back /// @param isAvax is the token actually native ether ? /// @return amountAConverted the amount of token A actually converted /// @return amountBConverted the amount of token B actually converted /// @return liquidity the amount of LP obtained function addLiquidityAndDeposit( uint256 amountA, uint256 amountB, uint256 amountAMin, uint256 amountBMin, bool isAvax ) external payable nonReentrant _harvest returns ( uint256 amountAConverted, uint256 amountBConverted, uint256 liquidity ) { if (isAvax && isWavaxPool) { uint256 amountWavax = (tokenA == wavax) ? amountA : amountB; require(amountWavax <= msg.value, "Not enough AVAX"); IWAVAX(wavax).deposit{value: msg.value}(); (address token, uint256 amount) = (tokenA == wavax) ? (tokenB, amountB) : (tokenA, amountA); IERC20(token).safeTransferFrom(msg.sender, address(this), amount); } else { IERC20(tokenA).safeTransferFrom(msg.sender, address(this), amountA); IERC20(tokenB).safeTransferFrom(msg.sender, address(this), amountB); } (amountAConverted, amountBConverted, liquidity) = _createLPTokens( amountA, amountB, amountAMin, amountBMin ); _deposit(liquidity); _stake(liquidity); IERC20(tokenB).safeTransfer(msg.sender, amountB - amountBConverted); IERC20(tokenA).safeTransfer(msg.sender, amountA - amountAConverted); emit NewDeposit(msg.sender, liquidity); } /// @notice stake the receipt token in the masterchief of VTX on behalf of the caller function stake(uint256 _amount) external { IERC20(stakingToken).safeTransferFrom(msg.sender, address(this), _amount); _approveTokenIfNeeded(stakingToken, masterVtx, _amount); IMasterChefVTX(masterVtx).depositFor(stakingToken, _amount, msg.sender); } function _withdraw(uint256 amount) internal { _unstake(amount); IMainStakingJoe(mainStakingJoe).withdraw(depositToken, amount); } /// @notice withdraw stables from mainStakingJoe, auto unstake from masterchief of VTX /// @dev performs a harvest of Joe before withdrawing /// @param amount the amount of LP tokens to withdraw function withdraw(uint256 amount) external _harvest nonReentrant { _withdraw(amount); IERC20(depositToken).safeTransfer(msg.sender, amount); emit NewWithdraw(msg.sender, amount); } /// @notice withdraw stables from mainStakingJoe, auto unstake from masterchief of VTX /// @dev performs a harvest of Joe before withdrawing /// @param amount the amount of stables to deposit /// @param amountAMin the minimum amount of token A to get back /// @param amountBMin the minimum amount of token B to get back /// @param isAvax is the token actually native ether ? function withdrawAndRemoveLiquidity( uint256 amount, uint256 amountAMin, uint256 amountBMin, bool isAvax ) external _harvest nonReentrant { _withdraw(amount); _approveTokenIfNeeded(depositToken, joeRouter, amount); _approveTokenIfNeeded(depositToken, depositToken, amount); if (isAvax && isWavaxPool) { (address token, uint256 amountTokenMin, uint256 amountAVAXMin) = tokenA == wavax ? (tokenB, amountBMin, amountAMin) : (tokenA, amountAMin, amountBMin); IJoeRouter02(joeRouter).removeLiquidityAVAX( token, amount, amountTokenMin, amountAVAXMin, msg.sender, block.timestamp ); } else { IJoeRouter02(joeRouter).removeLiquidity( tokenA, tokenB, amount, amountAMin, amountBMin, msg.sender, block.timestamp ); } emit NewWithdraw(msg.sender, amount); } /// @notice Harvest VTX and Joe rewards function getReward() external _harvest { IMasterChefVTX(masterVtx).depositFor(stakingToken, 0, msg.sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "IERC20.sol"; import "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 Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } 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. */ 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' 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)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _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). */ 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 require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^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 * ==== */ 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; 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]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (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._ */ 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._ */ 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._ */ 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._ */ 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"); (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._ */ 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._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (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._ */ 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._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IMainStakingJoe { function setXJoe(address _xJoe) external; function addFee( uint256 max, uint256 min, uint256 value, address to, bool isJoe, bool isAddress ) external; function setFee(uint256 index, uint256 value) external; function removeFee(uint256 index) external; function setCallerFee(uint256 value) external; function deposit(address token, uint256 amount) external; function harvest(address token, bool isUser) external; function sendTokenRewards(address _token, address _rewarder) external; function donateTokenRewards(address _token, address _rewarder) external; function withdraw(address token, uint256 _amount) external; function stakeJoe(uint256 amount) external; function stakeOrBufferJoe(uint256 amount) external; function stakeAllJoe() external; function claimVeJoe() external; function getStakedJoe() external view returns (uint256 stakedJoe); function getVeJoe() external view returns (uint256); function registerPool( uint256 _pid, address _token, string memory receiptName, string memory receiptSymbol, uint256 allocPoints ) external; function getPoolInfo(address _address) external view returns ( uint256 pid, bool isActive, address token, address receipt, address rewards_addr, address helper ); function removePool(address token) external; function setPoolHelper(address token, address _poolhelper) external; function setPoolRewarder(address token, address _poolRewarder) external; function setMasterChief(address _masterVtx) external; function setMasterJoe(address _masterJoe) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.2; import "IJoeRouter01.sol"; interface IJoeRouter02 is IJoeRouter01 { function removeLiquidityAVAXSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountAVAXMin, address to, uint256 deadline ) external returns (uint256 amountAVAX); function removeLiquidityAVAXWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountAVAXMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountAVAX); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactAVAXForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForAVAXSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; interface IJoeRouter01 { function factory() external pure returns (address); function WAVAX() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns ( uint256 amountA, uint256 amountB, uint256 liquidity ); function addLiquidityAVAX( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountAVAXMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountAVAX, uint256 liquidity ); function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityAVAX( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountAVAXMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountAVAX); function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityAVAXWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountAVAXMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountToken, uint256 amountAVAX); function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactAVAXForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function swapTokensForExactAVAX( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactTokensForAVAX( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapAVAXForExactTokens( uint256 amountOut, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountOut); function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountIn); function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IJoePair { event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint256); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; event Mint(address indexed sender, uint256 amount0, uint256 amount1); event Burn( address indexed sender, uint256 amount0, uint256 amount1, address indexed to ); event Swap( address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint256); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns ( uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast ); function price0CumulativeLast() external view returns (uint256); function price1CumulativeLast() external view returns (uint256); function kLast() external view returns (uint256); function mint(address to) external returns (uint256 liquidity); function burn(address to) external returns (uint256 amount0, uint256 amount1); function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "MintableERC20.sol"; library ERC20FactoryLib { function createERC20(string memory name_, string memory symbol_) public returns (address) { ERC20 token = new MintableERC20(name_, symbol_); return address(token); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "ERC20.sol"; import "Ownable.sol"; contract MintableERC20 is ERC20, Ownable { /* The ERC20 deployed will be owned by the others contracts of the protocol, specifically by Masterchief and MainStaking, forbidding the misuse of these functions for nefarious purposes */ constructor(string memory name_, string memory symbol_) ERC20(name_, symbol_) {} function mint(address account, uint256 amount) external virtual onlyOwner { _mint(account, amount); } function burn(address account, uint256 amount) external virtual onlyOwner { _burn(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "IERC20.sol"; import "IERC20Metadata.sol"; import "Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 420 }, "libraries": { "MainStakingJoe.sol": { "PoolHelperJoeFactoryLib": "0x69CdE7a07e3FFb839Ca69F635174c725F006E98B", "ERC20FactoryLib": "0x2ddC95E41d01DDD3268cd91A35A7bd7d0849d7Fc" } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Creation Code
6124c061003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063213014ab1461003a575b600080fd5b81801561004657600080fd5b5061005a610055366004610124565b610076565b6040516001600160a01b03909116815260200160405180910390f35b600080898989898989898960405161008d906100fb565b9788526001600160a01b039687166020890152948616604088015292851660608701529084166080860152831660a0850152821660c08401521660e082015261010001604051809103906000f0801580156100ec573d6000803e3d6000fd5b509a9950505050505050505050565b6122d6806101b583390190565b80356001600160a01b038116811461011f57600080fd5b919050565b600080600080600080600080610100898b03121561014157600080fd5b8835975061015160208a01610108565b965061015f60408a01610108565b955061016d60608a01610108565b945061017b60808a01610108565b935061018960a08a01610108565b925061019760c08a01610108565b91506101a560e08a01610108565b9050929598509295989093965056fe61018060405260016003553480156200001757600080fd5b50604051620022d6380380620022d68339810160408190526200003a9162000265565b610140889052606087811b6001600160601b0319908116608052600080546001600160a01b0319166001600160a01b038a1690811790915587831b82166101005286831b821660c05285831b8216610120529184901b1660a05260408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015620000cb57600080fd5b505afa158015620000e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000106919062000240565b600180546001600160a01b0319166001600160a01b039283161790556000546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b1580156200016057600080fd5b505afa15801562000175573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200019b919062000240565b600280546001600160a01b0319166001600160a01b0392831617905560015473b31f66aa3c1e785363f0875a1b74e27b85fd66c791161480620001fc57506002546001600160a01b031673b31f66aa3c1e785363f0875a1b74e27b85fd66c7145b151560f81b6101605260601b6001600160601b03191660e052506200030495505050505050565b80516001600160a01b03811681146200023b57600080fd5b919050565b6000602082840312156200025357600080fd5b6200025e8262000223565b9392505050565b600080600080600080600080610100898b0312156200028357600080fd5b885197506200029560208a0162000223565b9650620002a560408a0162000223565b9550620002b560608a0162000223565b9450620002c560808a0162000223565b9350620002d560a08a0162000223565b9250620002e560c08a0162000223565b9150620002f560e08a0162000223565b90509295985092959890939650565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c6101205160601c610140516101605160f81c611e7062000466600039600081816103bf01528181610bb901526111b3015260006104f90152600081816104c50152818161061c01528181610e2c0152611424015260008181610243015281816106db0152818161081c0152818161094b01528181610aa4015281816110060152818161114d01528181611487015281816116a201526116f00152600081816102e301528181610b7301528181610c7501528181610d4a0152818161173a0152818161177101526117ea0152600081816104030152818161058d015281816108c201528181610f0a01528181610f7b01526118c5015260008181610337015281816109cc0152610a5001526000818161038b015281816105520152818161088d01528181610ebc01528181610ee901528181610f4601526118900152611e706000f3fe60806040526004361061016f5760003560e01c806360384fdf116100d6578063b6b55f251161007f578063dcc3e06e11610059578063dcc3e06e146104b3578063f1068454146104e7578063f12297771461051b57600080fd5b8063b6b55f2514610445578063c7d0025314610465578063c89039c51461049357600080fd5b8063977f1a79116100b0578063977f1a79146103ad578063a296454f146103f1578063a694fc3a1461042557600080fd5b806360384fdf1461032557806370a082311461035957806372f702f31461037957600080fd5b80632e1a7d4d116101385780634bba83fd116101125780634bba83fd146102b157806359f571e8146102d15780635f64b55b1461030557600080fd5b80632e1a7d4d146102655780633d18b912146102875780634641257d1461029c57600080fd5b80628cc262146101745780630fc63d10146101ae578063117be4c2146101e657806318160ddd1461020e5780632bbeff8414610231575b600080fd5b34801561018057600080fd5b5061019461018f366004611b40565b61053b565b604080519283526020830191909152015b60405180910390f35b3480156101ba57600080fd5b506001546101ce906001600160a01b031681565b6040516001600160a01b0390911681526020016101a5565b3480156101f257600080fd5b506101ce73b31f66aa3c1e785363f0875a1b74e27b85fd66c781565b34801561021a57600080fd5b50610223610618565b6040519081526020016101a5565b34801561023d57600080fd5b506101ce7f000000000000000000000000000000000000000000000000000000000000000081565b34801561027157600080fd5b50610285610280366004611b7a565b6106b0565b005b34801561029357600080fd5b506102856107f1565b3480156102a857600080fd5b50610285610922565b3480156102bd57600080fd5b506102856102cc366004611cd0565b610a79565b3480156102dd57600080fd5b506101ce7f000000000000000000000000000000000000000000000000000000000000000081565b34801561031157600080fd5b506002546101ce906001600160a01b031681565b34801561033157600080fd5b506101ce7f000000000000000000000000000000000000000000000000000000000000000081565b34801561036557600080fd5b50610223610374366004611b40565b610e0a565b34801561038557600080fd5b506101ce7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103b957600080fd5b506103e17f000000000000000000000000000000000000000000000000000000000000000081565b60405190151581526020016101a5565b3480156103fd57600080fd5b506101ce7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043157600080fd5b50610285610440366004611b7a565b610eaf565b34801561045157600080fd5b50610285610460366004611b7a565b610fdb565b610478610473366004611d11565b6110c5565b604080519384526020840192909252908201526060016101a5565b34801561049f57600080fd5b506000546101ce906001600160a01b031681565b3480156104bf57600080fd5b506101ce7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104f357600080fd5b506102237f000000000000000000000000000000000000000000000000000000000000000081565b34801561052757600080fd5b50610223610536366004611b40565b611402565b60405163ad05e62760e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152336024830152828116604483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063ad05e6279060640160006040518083038186803b1580156105cf57600080fd5b505afa1580156105e3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060b9190810190611bac565b9296929550919350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561067357600080fd5b505afa158015610687573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ab9190611b93565b905090565b60008054604051635dfa042760e11b81526001600160a01b03918216600482015260248101929092527f0000000000000000000000000000000000000000000000000000000000000000169063bbf4084e90604401600060405180830381600087803b15801561071f57600080fd5b505af1158015610733573d6000803e3d6000fd5b505050506002600354141561078f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260035561079d81611455565b6000546107b4906001600160a01b031633836114b8565b60405181815233907fc0eb7a138362772da4d1d9adfe7f13a30f35b960c48ae439f3afcd4d08e814529060200160405180910390a2506001600355565b60008054604051635dfa042760e11b81526001600160a01b03918216600482015260248101929092527f0000000000000000000000000000000000000000000000000000000000000000169063bbf4084e90604401600060405180830381600087803b15801561086057600080fd5b505af1158015610874573d6000803e3d6000fd5b505060405163322083db60e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301523360448301527f000000000000000000000000000000000000000000000000000000000000000016925063c8820f6c9150606401600060405180830381600087803b15801561090857600080fd5b505af115801561091c573d6000803e3d6000fd5b50505050565b600054604051635dfa042760e11b81526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000000000000000000000000000000009091169063bbf4084e90604401600060405180830381600087803b15801561099157600080fd5b505af11580156109a5573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152610a7792503391506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190611b93565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691906114b8565b565b60008054604051635dfa042760e11b81526001600160a01b03918216600482015260248101929092527f0000000000000000000000000000000000000000000000000000000000000000169063bbf4084e90604401600060405180830381600087803b158015610ae857600080fd5b505af1158015610afc573d6000803e3d6000fd5b5050505060026003541415610b535760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610786565b6002600355610b6184611455565b600054610b98906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008661154d565b600054610baf906001600160a01b0316808661154d565b808015610bd957507f00000000000000000000000000000000000000000000000000000000000000005b15610cfc57600154600090819081906001600160a01b031673b31f66aa3c1e785363f0875a1b74e27b85fd66c714610c1e576001546001600160a01b03168686610c2d565b6002546001600160a01b031685875b6040516333c6b72560e01b81526001600160a01b038481166004830152602482018c905260448201849052606482018390523360848301524260a483015293965091945092507f0000000000000000000000000000000000000000000000000000000000000000909116906333c6b7259060c4016040805180830381600087803b158015610cba57600080fd5b505af1158015610cce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf29190611c7e565b5050505050610dca565b600154600254604051635d5155ef60e11b81526001600160a01b03928316600482015290821660248201526044810186905260648101859052608481018490523360a48201524260c48201527f00000000000000000000000000000000000000000000000000000000000000009091169063baa2abde9060e4016040805180830381600087803b158015610d8f57600080fd5b505af1158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190611c7e565b50505b60405184815233907fc0eb7a138362772da4d1d9adfe7f13a30f35b960c48ae439f3afcd4d08e814529060200160405180910390a2505060016003555050565b6040516370a0823160e01b81526001600160a01b0382811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906370a08231906024015b60206040518083038186803b158015610e7157600080fd5b505afa158015610e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea99190611b93565b92915050565b610ee46001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084611658565b610f2f7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008361154d565b60405163322083db60e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390523360448301527f0000000000000000000000000000000000000000000000000000000000000000169063c8820f6c906064015b600060405180830381600087803b158015610fc057600080fd5b505af1158015610fd4573d6000803e3d6000fd5b5050505050565b60008054604051635dfa042760e11b81526001600160a01b03918216600482015260248101929092527f0000000000000000000000000000000000000000000000000000000000000000169063bbf4084e90604401600060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505060005461107b92506001600160a01b03169050333084611658565b61108481611690565b61108d81610ee4565b60405181815233907f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de3649060200160405180910390a250565b60008060006002600354141561111d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610786565b600260035560008054604051635dfa042760e11b81526001600160a01b03918216600482015260248101929092527f0000000000000000000000000000000000000000000000000000000000000000169063bbf4084e90604401600060405180830381600087803b15801561119157600080fd5b505af11580156111a5573d6000803e3d6000fd5b505050508380156111d357507f00000000000000000000000000000000000000000000000000000000000000005b15611323576001546000906001600160a01b031673b31f66aa3c1e785363f0875a1b74e27b85fd66c7146112075787611209565b885b90503481111561124d5760405162461bcd60e51b815260206004820152600f60248201526e09cdee840cadcdeeaced04082ac82b608b1b6044820152606401610786565b73b31f66aa3c1e785363f0875a1b74e27b85fd66c76001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561129c57600080fd5b505af11580156112b0573d6000803e3d6000fd5b5050600154600093508392506001600160a01b031673b31f66aa3c1e785363f0875a1b74e27b85fd66c71490506112f3576001546001600160a01b03168b611301565b6002546001600160a01b03168a5b909250905061131b6001600160a01b038316333084611658565b505050611353565b60015461133b906001600160a01b031633308b611658565b600254611353906001600160a01b031633308a611658565b61135f88888888611721565b9194509250905061136f81611690565b61137881610ee4565b61139933611386848a611dad565b6002546001600160a01b031691906114b8565b6113ba336113a7858b611dad565b6001546001600160a01b031691906114b8565b60405181815233907f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de3649060200160405180910390a26001600381905550955095509592505050565b60405163f122977760e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063f122977790602401610e59565b61145e81611879565b60005460405163f3fef3a360e01b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063f3fef3a390604401610fa6565b6040516001600160a01b03831660248201526044810182905261154890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526118f4565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015282919085169063dd62ed3e9060440160206040518083038186803b15801561159757600080fd5b505afa1580156115ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cf9190611b93565b10156115485760405163095ea7b360e01b81526001600160a01b038381166004830152600019602483015284169063095ea7b390604401602060405180830381600087803b15801561162057600080fd5b505af1158015611634573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c9190611b5d565b6040516001600160a01b038085166024830152831660448201526064810182905261091c9085906323b872dd60e01b906084016114e4565b6000546116c7906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008361154d565b6000546040516311f9fbc960e21b81526001600160a01b039182166004820152602481018390527f0000000000000000000000000000000000000000000000000000000000000000909116906347e7ef2490604401610fa6565b6001546000908190819061175f906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008961154d565b600254611796906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008861154d565b60015460025460405162e8e33760e81b81526001600160a01b039283166004820152908216602482015260448101899052606481018890526084810187905260a481018690523060c48201524260e48201527f00000000000000000000000000000000000000000000000000000000000000009091169063e8e337009061010401606060405180830381600087803b15801561183157600080fd5b505af1158015611845573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118699190611ca2565b9199909850909650945050505050565b6040516333b377df60e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390523360448301527f00000000000000000000000000000000000000000000000000000000000000001690636766efbe90606401610fa6565b6000611949826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119c69092919063ffffffff16565b80519091501561154857808060200190518101906119679190611b5d565b6115485760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610786565b60606119d584846000856119df565b90505b9392505050565b606082471015611a405760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610786565b843b611a8e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610786565b600080866001600160a01b03168587604051611aaa9190611d5e565b60006040518083038185875af1925050503d8060008114611ae7576040519150601f19603f3d011682016040523d82523d6000602084013e611aec565b606091505b5091509150611afc828286611b07565b979650505050505050565b60608315611b165750816119d8565b825115611b265782518084602001fd5b8160405162461bcd60e51b81526004016107869190611d7a565b600060208284031215611b5257600080fd5b81356119d881611e14565b600060208284031215611b6f57600080fd5b81516119d881611e2c565b600060208284031215611b8c57600080fd5b5035919050565b600060208284031215611ba557600080fd5b5051919050565b60008060008060808587031215611bc257600080fd5b845193506020850151611bd481611e14565b604086015190935067ffffffffffffffff80821115611bf257600080fd5b818701915087601f830112611c0657600080fd5b815181811115611c1857611c18611dfe565b604051601f8201601f19908116603f01168101908382118183101715611c4057611c40611dfe565b816040528281528a6020848701011115611c5957600080fd5b611c6a836020830160208801611dd2565b60609990990151979a969950505050505050565b60008060408385031215611c9157600080fd5b505080516020909101519092909150565b600080600060608486031215611cb757600080fd5b8351925060208401519150604084015190509250925092565b60008060008060808587031215611ce657600080fd5b8435935060208501359250604085013591506060850135611d0681611e2c565b939692955090935050565b600080600080600060a08688031215611d2957600080fd5b853594506020860135935060408601359250606086013591506080860135611d5081611e2c565b809150509295509295909350565b60008251611d70818460208701611dd2565b9190910192915050565b6020815260008251806020840152611d99816040850160208701611dd2565b601f01601f19169190910160400192915050565b600082821015611dcd57634e487b7160e01b600052601160045260246000fd5b500390565b60005b83811015611ded578181015183820152602001611dd5565b8381111561091c5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611e2957600080fd5b50565b8015158114611e2957600080fdfea2646970667358221220a046bae5c7ab69b403a72e229412bdae7e1299ac8cd3bd621bc4ab5c36d716cc64736f6c63430008070033a26469706673582212200bda130a6c669d93c69627649372b41261bdaaabff8ad289dbf1bfa24f4927ee64736f6c63430008070033
Deployed ByteCode Sourcemap
85:594:25:-:0;;;;;;;;;;;;;;;;;;;;;;;;123:554;;;;;;;;;;-1:-1:-1;123:554:25;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1095:55:28;;;1077:74;;1065:2;1050:18;123:554:25;;;;;;;;388:7;407:18;459:4;477:13;504;531:12;557:10;581:9;604:5;623:7;428:212;;;;;:::i;:::-;1505:25:28;;;-1:-1:-1;;;;;1627:15:28;;;1622:2;1607:18;;1600:43;1679:15;;;1674:2;1659:18;;1652:43;1731:15;;;1726:2;1711:18;;1704:43;1784:15;;;1778:3;1763:19;;1756:44;1837:15;;1831:3;1816:19;;1809:44;1890:15;;1884:3;1869:19;;1862:44;1943:15;1937:3;1922:19;;1915:44;1492:3;1477:19;428:212:25;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;407:233:25;123:554;-1:-1:-1;;;;;;;;;;123:554:25:o;-1:-1:-1:-;;;;;;;;:::o;14:196:28:-;82:20;;-1:-1:-1;;;;;131:54:28;;121:65;;111:93;;200:1;197;190:12;111:93;14:196;;;:::o;215:703::-;337:6;345;353;361;369;377;385;393;446:3;434:9;425:7;421:23;417:33;414:53;;;463:1;460;453:12;414:53;499:9;486:23;476:33;;528:38;562:2;551:9;547:18;528:38;:::i;:::-;518:48;;585:38;619:2;608:9;604:18;585:38;:::i;:::-;575:48;;642:38;676:2;665:9;661:18;642:38;:::i;:::-;632:48;;699:39;733:3;722:9;718:19;699:39;:::i;:::-;689:49;;757:39;791:3;780:9;776:19;757:39;:::i;:::-;747:49;;815:39;849:3;838:9;834:19;815:39;:::i;:::-;805:49;;873:39;907:3;896:9;892:19;873:39;:::i;:::-;863:49;;215:703;;;;;;;;;;;:::o
Swarm Source
ipfs://0bda130a6c669d93c69627649372b41261bdaaabff8ad289dbf1bfa24f4927ee
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.