编译器
0.6.12+commit.27d51765
文件 1 的 23:AccessControl.sol
pragma solidity >=0.6.0 <0.8.0;
import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
abstract contract AccessControl is Context {
using EnumerableSet for EnumerableSet.AddressSet;
using Address for address;
struct RoleData {
EnumerableSet.AddressSet members;
bytes32 adminRole;
}
mapping (bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function hasRole(bytes32 role, address account) public view returns (bool) {
return _roles[role].members.contains(account);
}
function getRoleMemberCount(bytes32 role) public view returns (uint256) {
return _roles[role].members.length();
}
function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
return _roles[role].members.at(index);
}
function getRoleAdmin(bytes32 role) public view returns (bytes32) {
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account) public virtual {
require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account) public virtual {
require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account) public virtual {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
_roles[role].adminRole = adminRole;
}
function _grantRole(bytes32 role, address account) private {
if (_roles[role].members.add(account)) {
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) private {
if (_roles[role].members.remove(account)) {
emit RoleRevoked(role, account, _msgSender());
}
}
}
文件 2 的 23:Address.sol
pragma solidity >=0.6.2 <0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
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");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
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);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
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);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
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);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 3 的 23:Context.sol
pragma solidity >=0.6.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
文件 4 的 23:ECDSA.sol
pragma solidity >=0.6.0 <0.8.0;
library ECDSA {
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
if (signature.length != 65) {
revert("ECDSA: invalid signature length");
}
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return recover(hash, v, r, s);
}
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");
address signer = ecrecover(hash, v, r, s);
require(signer != address(0), "ECDSA: invalid signature");
return signer;
}
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
}
文件 5 的 23:EnumerableSet.sol
pragma solidity >=0.6.0 <0.8.0;
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping (bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
function _remove(Set storage set, bytes32 value) private returns (bool) {
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
bytes32 lastvalue = set._values[lastIndex];
set._values[toDeleteIndex] = lastvalue;
set._indexes[lastvalue] = toDeleteIndex + 1;
set._values.pop();
delete set._indexes[value];
return true;
} else {
return false;
}
}
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
struct Bytes32Set {
Set _inner;
}
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
struct AddressSet {
Set _inner;
}
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
文件 6 的 23:IERC165.sol
pragma solidity >=0.6.0 <0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 7 的 23:IERC20.sol
pragma solidity >=0.6.0 <0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 8 的 23:IERC721.sol
pragma solidity >=0.6.2 <0.8.0;
import "../../introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
文件 9 的 23:IERC721Receiver.sol
pragma solidity >=0.6.0 <0.8.0;
interface IERC721Receiver {
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
文件 10 的 23:IMasterChef.sol
import "./IOREO.sol";
pragma solidity 0.6.12;
interface IMasterChef {
function poolLength() external view returns (uint256);
function pendingOreo(address _stakeToken, address _user) external view returns (uint256);
function userInfo(address _stakeToken, address _user)
external
view
returns (
uint256,
uint256,
address
);
function poolInfo(address _stakeToken)
external
view
returns (
uint256,
uint256,
uint256,
uint256
);
function devAddr() external view returns (address);
function refAddr() external view returns (address);
function bonusMultiplier() external view returns (uint256);
function totalAllocPoint() external view returns (uint256);
function oreoPerBlock() external view returns (uint256);
function addPool(
address _stakeToken,
uint256 _allocPoint,
uint256 _depositFee
) external;
function setPool(
address _stakeToken,
uint256 _allocPoint,
uint256 _depositFee
) external;
function updatePool(address _stakeToken) external;
function removePool(address _stakeToken) external;
function deposit(
address _for,
address _stakeToken,
uint256 _amount
) external;
function withdraw(
address _for,
address _stakeToken,
uint256 _amount
) external;
function depositOreo(address _for, uint256 _amount) external;
function withdrawOreo(address _for, uint256 _amount) external;
function harvest(address _for, address _stakeToken) external;
function harvest(address _for, address[] calldata _stakeToken) external;
function emergencyWithdraw(address _for, address _stakeToken) external;
function mintExtraReward(
address _stakeToken,
address _to,
uint256 _amount
) external;
function oreo() external returns (IOREO);
}
文件 11 的 23:IMasterChefCallback.sol
pragma solidity 0.6.12;
interface IMasterChefCallback {
function masterChefCall(
address stakeToken,
address userAddr,
uint256 unboostedReward
) external;
}
文件 12 的 23:IOREO.sol
pragma solidity 0.6.12;
interface IOREO {
function lock(address _account, uint256 _amount) external;
function lockOf(address _account) external view returns (uint256);
function unlock() external;
function mint(address _to, uint256 _amount) external;
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function startReleaseBlock() external view returns (uint256);
function endReleaseBlock() external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 13 的 23:IOreoBoosterConfig.sol
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
interface IOreoBoosterConfig {
function energyInfo(address nftAddress, uint256 nftTokenId)
external
view
returns (
uint256 maxEnergy,
uint256 currentEnergy,
uint256 boostBps
);
function oreoboosterNftAllowance(
address stakingToken,
address nftAddress,
uint256 nftTokenId
) external view returns (bool);
function stakeTokenAllowance(address stakingToken) external view returns (bool);
function callerAllowance(address caller) external view returns (bool);
function consumeEnergy(
address nftAddress,
uint256 nftTokenId,
uint256 energyToBeConsumed
) external;
}
文件 14 的 23:IWETH.sol
pragma solidity >=0.5.0;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
function withdraw(uint256) external;
}
文件 15 的 23:IWNativeRelayer.sol
pragma solidity 0.6.12;
interface IWNativeRelayer {
function withdraw(uint256 _amount) external;
}
文件 16 的 23:Math.sol
pragma solidity >=0.6.0 <0.8.0;
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
文件 17 的 23:OreoBooster.sol
pragma solidity 0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/cryptography/ECDSA.sol";
import "../farm/interfaces/IMasterChef.sol";
import "../farm/interfaces/IMasterChefCallback.sol";
import "./interfaces/IOreoBoosterConfig.sol";
import "../periphery/interfaces/IWNativeRelayer.sol";
import "../interfaces/IWETH.sol";
import "../periphery/library/SafeToken.sol";
contract OreoBooster is Ownable, Pausable, ReentrancyGuard, AccessControl, IMasterChefCallback, IERC721Receiver {
using SafeERC20 for IERC20;
using SafeMath for uint256;
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
bytes32 public constant GOVERNANCE_ROLE = keccak256("GOVERNANCE_ROLE");
bytes32 public constant SIGNATURE_HASH = 0x08367bb0e0d2abf304a79452b2b95f4dc75fda0fc6df55dca6e5ad183de10cf0;
IMasterChef public masterChef;
IOreoBoosterConfig public oreoboosterConfig;
IERC20 public oreo;
IWNativeRelayer public wNativeRelayer;
address public wNative;
struct UserInfo {
uint256 accumBoostedReward;
uint256 lastUserActionTime;
}
struct NFTStakingInfo {
address nftAddress;
uint256 nftTokenId;
}
mapping(address => mapping(address => UserInfo)) public userInfo;
mapping(address => uint256) public totalAccumBoostedReward;
mapping(address => mapping(address => NFTStakingInfo)) public userStakingNFT;
uint256 public _IN_EXEC_LOCK;
event StakeNFT(address indexed staker, address indexed stakeToken, address nftAddress, uint256 nftTokenId);
event UnstakeNFT(address indexed staker, address indexed stakeToken, address nftAddress, uint256 nftTokenId);
event Stake(address indexed staker, IERC20 indexed stakeToken, uint256 amount);
event Unstake(address indexed unstaker, IERC20 indexed stakeToken, uint256 amount);
event Harvest(address indexed harvester, IERC20 indexed stakeToken, uint256 amount);
event EmergencyWithdraw(address indexed caller, IERC20 indexed stakeToken, uint256 amount);
event MasterChefCall(
address indexed user,
uint256 extraReward,
address stakeToken,
uint256 prevEnergy,
uint256 currentEnergy
);
event Pause();
event Unpause();
constructor(
IERC20 _oreo,
IMasterChef _masterChef,
IOreoBoosterConfig _oreoboosterConfig,
IWNativeRelayer _wNativeRelayer,
address _wNative
) public {
require(_wNative != address(0), "OreoBooster::constructor:: _wNative cannot be address(0)");
require(address(_oreo) != address(0), "OreoNFTOffering::constructor:: _oreo cannot be address(0)");
require(address(_masterChef) != address(0), "OreoNFTOffering::constructor:: _masterChef cannot be address(0)");
require(
address(_oreoboosterConfig) != address(0),
"OreoNFTOffering::constructor:: _oreoboosterConfig cannot be address(0)"
);
require(
address(_wNativeRelayer) != address(0),
"OreoNFTOffering::constructor:: _wNativeRelayer cannot be address(0)"
);
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(GOVERNANCE_ROLE, _msgSender());
masterChef = _masterChef;
oreoboosterConfig = _oreoboosterConfig;
oreo = _oreo;
wNativeRelayer = _wNativeRelayer;
wNative = _wNative;
_IN_EXEC_LOCK = _NOT_ENTERED;
}
modifier inExec() {
require(_IN_EXEC_LOCK == _NOT_ENTERED, "OreoBooster::inExec:: in exec lock");
require(address(masterChef) == _msgSender(), "OreoBooster::inExec:: not from the master chef");
_IN_EXEC_LOCK = _ENTERED;
_;
_IN_EXEC_LOCK = _NOT_ENTERED;
}
modifier isStakeTokenOK(address _stakeToken) {
require(oreoboosterConfig.stakeTokenAllowance(_stakeToken), "OreoBooster::isStakeTokenOK::bad stake token");
_;
}
modifier isOreoBoosterNftOK(
address _stakeToken,
address _nftAddress,
uint256 _nftTokenId
) {
require(
oreoboosterConfig.oreoboosterNftAllowance(_stakeToken, _nftAddress, _nftTokenId),
"OreoBooster::isOreoBoosterNftOK::bad nft"
);
_;
}
modifier permit(bytes calldata _sig) {
address recoveredAddress = ECDSA.recover(ECDSA.toEthSignedMessageHash(SIGNATURE_HASH), _sig);
require(recoveredAddress == _msgSender(), "OreoBooster::permit::INVALID_SIGNATURE");
_;
}
modifier onlyGovernance() {
require(hasRole(GOVERNANCE_ROLE, _msgSender()), "OreoBooster::onlyGovernance::only GOVERNANCE role");
_;
}
modifier onlyEOA() {
require(msg.sender == tx.origin, "OreoBooster::onlyEOA:: not eoa");
_;
}
function pause() external onlyGovernance whenNotPaused {
_pause();
emit Pause();
}
function unpause() external onlyGovernance whenPaused {
_unpause();
emit Unpause();
}
function pendingBoosterOreo(address _stakeToken, address _user) external view returns (uint256) {
uint256 pendingOreo = masterChef.pendingOreo(_stakeToken, _user);
NFTStakingInfo memory stakingNFT = userStakingNFT[_stakeToken][_user];
if (stakingNFT.nftAddress == address(0)) {
return 0;
}
(, , uint256 boostBps) = oreoboosterConfig.energyInfo(stakingNFT.nftAddress, stakingNFT.nftTokenId);
return pendingOreo.mul(boostBps).div(1e4);
}
function _withdrawFromMasterChef(IERC20 _stakeToken, uint256 _shares) internal {
if (_shares == 0) return;
if (address(_stakeToken) == address(oreo)) {
masterChef.withdrawOreo(_msgSender(), _shares);
} else {
masterChef.withdraw(_msgSender(), address(_stakeToken), _shares);
}
}
function _harvestFromMasterChef(address user, IERC20 _stakeToken) internal {
(uint256 userStakeAmount, , ) = masterChef.userInfo(address(_stakeToken), user);
if (userStakeAmount == 0) {
emit Harvest(user, _stakeToken, 0);
return;
}
uint256 beforeReward = oreo.balanceOf(user);
masterChef.harvest(user, address(_stakeToken));
emit Harvest(user, _stakeToken, oreo.balanceOf(user).sub(beforeReward));
}
function stakeNFT(
address _stakeToken,
address _nftAddress,
uint256 _nftTokenId
)
external
whenNotPaused
isStakeTokenOK(_stakeToken)
isOreoBoosterNftOK(_stakeToken, _nftAddress, _nftTokenId)
nonReentrant
onlyEOA
{
_stakeNFT(_stakeToken, _nftAddress, _nftTokenId);
}
function _stakeNFT(
address _stakeToken,
address _nftAddress,
uint256 _nftTokenId
) internal {
NFTStakingInfo memory toBeSentBackNft = userStakingNFT[_stakeToken][_msgSender()];
require(
toBeSentBackNft.nftAddress != _nftAddress || toBeSentBackNft.nftTokenId != _nftTokenId,
"OreoBooster::stakeNFT:: nft already staked"
);
_harvestFromMasterChef(_msgSender(), IERC20(_stakeToken));
userStakingNFT[_stakeToken][_msgSender()] = NFTStakingInfo({ nftAddress: _nftAddress, nftTokenId: _nftTokenId });
IERC721(_nftAddress).safeTransferFrom(_msgSender(), address(this), _nftTokenId);
if (toBeSentBackNft.nftAddress != address(0)) {
IERC721(toBeSentBackNft.nftAddress).safeTransferFrom(address(this), _msgSender(), toBeSentBackNft.nftTokenId);
}
emit StakeNFT(_msgSender(), _stakeToken, _nftAddress, _nftTokenId);
}
function unstakeNFT(address _stakeToken) external isStakeTokenOK(_stakeToken) nonReentrant onlyEOA {
_unstakeNFT(_stakeToken);
}
function _unstakeNFT(address _stakeToken) internal {
NFTStakingInfo memory toBeSentBackNft = userStakingNFT[_stakeToken][_msgSender()];
require(toBeSentBackNft.nftAddress != address(0), "OreoBooster::stakeNFT:: no nft staked");
_harvestFromMasterChef(_msgSender(), IERC20(_stakeToken));
userStakingNFT[_stakeToken][_msgSender()] = NFTStakingInfo({ nftAddress: address(0), nftTokenId: 0 });
IERC721(toBeSentBackNft.nftAddress).safeTransferFrom(address(this), _msgSender(), toBeSentBackNft.nftTokenId);
emit UnstakeNFT(_msgSender(), _stakeToken, toBeSentBackNft.nftAddress, toBeSentBackNft.nftTokenId);
}
function stake(IERC20 _stakeToken, uint256 _amount)
external
payable
whenNotPaused
isStakeTokenOK(address(_stakeToken))
nonReentrant
{
require(_amount > 0, "OreoBooster::stake::nothing to stake");
UserInfo storage user = userInfo[address(_stakeToken)][_msgSender()];
_harvestFromMasterChef(_msgSender(), _stakeToken);
user.lastUserActionTime = block.timestamp;
_stakeToken.safeApprove(address(masterChef), _amount);
_safeWrap(_stakeToken, _amount);
if (address(_stakeToken) == address(oreo)) {
masterChef.depositOreo(_msgSender(), _amount);
} else {
masterChef.deposit(_msgSender(), address(_stakeToken), _amount);
}
_stakeToken.safeApprove(address(masterChef), 0);
emit Stake(_msgSender(), _stakeToken, _amount);
}
function _unstake(IERC20 _stakeToken, uint256 _amount) internal {
require(_amount > 0, "OreoBooster::_unstake::use harvest instead");
UserInfo storage user = userInfo[address(_stakeToken)][_msgSender()];
_withdrawFromMasterChef(_stakeToken, _amount);
user.lastUserActionTime = block.timestamp;
_safeUnwrap(_stakeToken, _msgSender(), _amount);
emit Unstake(_msgSender(), _stakeToken, _amount);
}
function unstake(address _stakeToken, uint256 _amount) external isStakeTokenOK(_stakeToken) nonReentrant {
_unstake(IERC20(_stakeToken), _amount);
}
function unstakeAll(address _stakeToken) external isStakeTokenOK(_stakeToken) nonReentrant {
(uint256 userStakeAmount, , ) = masterChef.userInfo(address(_stakeToken), _msgSender());
_unstake(IERC20(_stakeToken), userStakeAmount);
}
function harvest(address _stakeToken) external whenNotPaused isStakeTokenOK(_stakeToken) nonReentrant {
_harvestFromMasterChef(_msgSender(), IERC20(_stakeToken));
}
function harvest(address[] calldata _stakeTokens) external whenNotPaused nonReentrant {
for (uint256 i = 0; i < _stakeTokens.length; i++) {
require(oreoboosterConfig.stakeTokenAllowance(_stakeTokens[i]), "OreoBooster::harvest::bad stake token");
_harvestFromMasterChef(_msgSender(), IERC20(_stakeTokens[i]));
}
}
function masterChefCall(
address stakeToken,
address userAddr,
uint256 unboostedReward
) external override inExec {
NFTStakingInfo memory stakingNFT = userStakingNFT[stakeToken][userAddr];
UserInfo storage user = userInfo[stakeToken][userAddr];
if (stakingNFT.nftAddress == address(0)) {
return;
}
(, uint256 currentEnergy, uint256 boostBps) = oreoboosterConfig.energyInfo(
stakingNFT.nftAddress,
stakingNFT.nftTokenId
);
uint256 extraReward = unboostedReward.mul(boostBps).div(1e4);
totalAccumBoostedReward[stakeToken] = totalAccumBoostedReward[stakeToken].add(extraReward);
user.accumBoostedReward = user.accumBoostedReward.add(extraReward);
uint256 newEnergy = 0;
masterChef.mintExtraReward(stakeToken, userAddr, extraReward);
emit MasterChefCall(userAddr, extraReward, stakeToken, currentEnergy, newEnergy);
}
function _safeWrap(IERC20 _quoteBep20, uint256 _amount) internal {
if (msg.value != 0) {
require(address(_quoteBep20) == wNative, "OreoBooster::_safeWrap:: baseToken is not wNative");
require(_amount == msg.value, "OreoBooster::_safeWrap:: value != msg.value");
IWETH(wNative).deposit{ value: msg.value }();
return;
}
_quoteBep20.safeTransferFrom(_msgSender(), address(this), _amount);
}
function _safeUnwrap(
IERC20 _quoteBep20,
address _to,
uint256 _amount
) internal {
if (address(_quoteBep20) == wNative) {
_quoteBep20.safeTransfer(address(wNativeRelayer), _amount);
wNativeRelayer.withdraw(_amount);
SafeToken.safeTransferETH(_to, _amount);
return;
}
_quoteBep20.safeTransfer(_to, _amount);
}
function emergencyWithdraw(IERC20 _stakeToken) external isStakeTokenOK(address(_stakeToken)) {
UserInfo storage user = userInfo[address(_stakeToken)][_msgSender()];
(uint256 userStakeAmount, , ) = masterChef.userInfo(address(_stakeToken), _msgSender());
user.lastUserActionTime = block.timestamp;
masterChef.emergencyWithdraw(_msgSender(), address(_stakeToken));
emit EmergencyWithdraw(_msgSender(), _stakeToken, userStakeAmount);
}
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external override returns (bytes4) {
return IERC721Receiver.onERC721Received.selector;
}
receive() external payable {}
}
文件 18 的 23:Ownable.sol
pragma solidity >=0.6.0 <0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
文件 19 的 23:Pausable.sol
pragma solidity >=0.6.0 <0.8.0;
import "./Context.sol";
abstract contract Pausable is Context {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 20 的 23:ReentrancyGuard.sol
pragma solidity >=0.6.0 <0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () internal {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 21 的 23:SafeERC20.sol
pragma solidity >=0.6.0 <0.8.0;
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
library SafeERC20 {
using SafeMath for uint256;
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));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
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).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 22 的 23:SafeMath.sol
pragma solidity >=0.6.0 <0.8.0;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
文件 23 的 23:SafeToken.sol
pragma solidity 0.6.12;
interface ERC20Interface {
function balanceOf(address user) external view returns (uint256);
}
library SafeToken {
function myBalance(address token) internal view returns (uint256) {
return ERC20Interface(token).balanceOf(address(this));
}
function balanceOf(address token, address user) internal view returns (uint256) {
return ERC20Interface(token).balanceOf(user);
}
function safeApprove(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeApprove");
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransfer");
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransferFrom");
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{ value: value }(new bytes(0));
require(success, "!safeTransferETH");
}
}
{
"compilationTarget": {
"contracts/nft/OreoBooster.sol": "OreoBooster"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"contract IERC20","name":"_oreo","type":"address"},{"internalType":"contract IMasterChef","name":"_masterChef","type":"address"},{"internalType":"contract IOreoBoosterConfig","name":"_oreoboosterConfig","type":"address"},{"internalType":"contract IWNativeRelayer","name":"_wNativeRelayer","type":"address"},{"internalType":"address","name":"_wNative","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"harvester","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"extraReward","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"prevEnergy","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentEnergy","type":"uint256"}],"name":"MasterChefCall","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"address","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"StakeNFT","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"unstaker","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"address","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"UnstakeNFT","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOVERNANCE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNATURE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_IN_EXEC_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_stakeToken","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_stakeTokens","type":"address[]"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterChef","outputs":[{"internalType":"contract IMasterChef","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakeToken","type":"address"},{"internalType":"address","name":"userAddr","type":"address"},{"internalType":"uint256","name":"unboostedReward","type":"uint256"}],"name":"masterChefCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oreo","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oreoboosterConfig","outputs":[{"internalType":"contract IOreoBoosterConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingBoosterOreo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_stakeToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_nftTokenId","type":"uint256"}],"name":"stakeNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalAccumBoostedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"}],"name":"unstakeAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"}],"name":"unstakeNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"accumBoostedReward","type":"uint256"},{"internalType":"uint256","name":"lastUserActionTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userStakingNFT","outputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wNative","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wNativeRelayer","outputs":[{"internalType":"contract IWNativeRelayer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]