Source Code
Overview
S Balance
S Value
$0.00Latest 25 from a total of 1,011 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Deposit | 47786213 | 126 days ago | IN | 0 S | 0.07554552 | ||||
| Deposit | 47783389 | 126 days ago | IN | 0 S | 0.07348352 | ||||
| Deposit | 47780428 | 126 days ago | IN | 0 S | 0.07311524 | ||||
| Deposit | 47777398 | 126 days ago | IN | 0 S | 0.07134831 | ||||
| Deposit | 47774406 | 126 days ago | IN | 0 S | 0.07620734 | ||||
| Deposit | 47772140 | 126 days ago | IN | 0 S | 0.07237851 | ||||
| Deposit | 47769972 | 126 days ago | IN | 0 S | 0.07201012 | ||||
| Deposit | 47767689 | 126 days ago | IN | 0 S | 0.07024325 | ||||
| Deposit | 47765580 | 126 days ago | IN | 0 S | 0.07510228 | ||||
| Deposit | 47763273 | 126 days ago | IN | 0 S | 0.07127345 | ||||
| Deposit | 47760944 | 126 days ago | IN | 0 S | 0.07090506 | ||||
| Deposit | 47758093 | 126 days ago | IN | 0 S | 0.06913813 | ||||
| Deposit | 47752855 | 126 days ago | IN | 0 S | 0.07399727 | ||||
| Deposit | 47744604 | 126 days ago | IN | 0 S | 0.06876985 | ||||
| Deposit | 47737616 | 126 days ago | IN | 0 S | 0.07016845 | ||||
| Deposit | 47733412 | 126 days ago | IN | 0 S | 0.06840152 | ||||
| Deposit | 47718288 | 126 days ago | IN | 0 S | 0.06922646 | ||||
| Deposit | 47700232 | 126 days ago | IN | 0 S | 0.06986529 | ||||
| Deposit | 47694208 | 127 days ago | IN | 0 S | 0.12518088 | ||||
| Deposit | 47684718 | 127 days ago | IN | 0 S | 0.0732606 | ||||
| Deposit | 47682735 | 127 days ago | IN | 0 S | 0.06803318 | ||||
| Deposit | 47680724 | 127 days ago | IN | 0 S | 0.06885813 | ||||
| Deposit | 47676519 | 127 days ago | IN | 0 S | 0.07186201 | ||||
| Deposit | 47674227 | 127 days ago | IN | 0 S | 0.07186201 | ||||
| Deposit | 47671982 | 127 days ago | IN | 0 S | 0.06922646 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x19d04a9B...4C9C6E395 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
SafeHaven
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity =0.8.20;
import {ITreasury} from "./interfaces/external/ITreasury.sol";
import {IWomo} from "./interfaces/external/IWomo.sol";
import {IRebaser} from "./interfaces/external/IRebaser.sol";
import {IStaking} from "./interfaces/external/IStaking.sol";
import {LowGasSafeMath} from "./libs/LowGasSafeMath.sol";
import {TransferHelper} from "./libs/TransferHelper.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract SafeHaven is Ownable, ReentrancyGuard {
using LowGasSafeMath for uint256;
using LowGasSafeMath for uint32;
/* ======== EVENTS ======== */
event BondCreated(
address indexed to,
uint bid,
uint indexed payout,
uint indexed expires
);
event BondRedeemed(
address indexed recipient,
uint bid,
uint payout,
uint remaining
);
event VestingTermChanged(uint32 oldValue, uint32 newValue);
event AdditionalBipsChanged(uint oldValue, uint newValue);
struct Bond {
uint fragmentsReward; // Fragments remaining to be paid
uint32 vesting; // Seconds left to vest
uint32 lastTime; // Last interaction
uint maxTokenRewards; // Tokens reserved
}
struct Terms {
uint additionalBips; // additional fragments percentage for example 1e4 is 100%
uint32 vestingTerm; // in seconds
}
uint256 public constant BPS = 10000;
ITreasury public immutable treasury;
IWomo public immutable womo;
IRebaser public immutable rebaser;
bool public autoClaimBonds;
uint256 public maxAutoClaimsPerTx = 20;
uint256 public lastProcessedIndex = 0;
uint256 public reservesFragments;
uint256 public maxSupply;
mapping(address => Bond[]) public bondInfo; // stores bond information for depositors
mapping(address => bool) public hasActiveBonds; // Check active bonds
mapping(address => uint256) public userBondIndex;
address[] public usersWithBonds; // Users list with bonds
Terms public terms; // stores terms for new bonds
error MaxSupplyExceeded();
constructor(
ITreasury _treasury,
IWomo _womo,
IRebaser _rebaser,
uint256 _maxSupply
) {
treasury = _treasury;
womo = _womo;
rebaser = _rebaser;
autoClaimBonds = true;
maxSupply = _maxSupply; //1B
}
function initializeSafeHavenTerms(
uint _additionalBips,
uint32 _vestingTerm
) external onlyOwner {
require(_vestingTerm >= 129600, "Vesting must be longer than 36 hours");
terms = Terms({
additionalBips: _additionalBips,
vestingTerm: _vestingTerm
});
}
function setVestingTerm(uint32 _input) external onlyOwner {
require(_input >= 129600, "Vesting must be longer than 36 hours");
uint32 oldValue = terms.vestingTerm;
terms.vestingTerm = _input;
emit VestingTermChanged(oldValue, terms.vestingTerm);
}
function setAdditionalBips(uint _bips) external onlyOwner {
uint oldValue = terms.additionalBips;
terms.additionalBips = _bips;
emit AdditionalBipsChanged(oldValue, terms.additionalBips);
}
function getBondsLength(address user) public view returns (uint) {
return bondInfo[user].length;
}
function deposit(
address _to,
uint amountDesiredA,
uint amountDesiredB,
uint amountAMin,
uint amountBMin,
uint deadline
) external returns (uint) {
require(_to != address(0), "Invalid address");
uint fragments = treasury.deposit(
msg.sender,
amountDesiredA,
amountDesiredB,
amountAMin,
amountBMin,
deadline
);
fragments = fragments.add(fragments.mul(terms.additionalBips) / BPS);
uint maxTokenRewards = _debtCalculator(fragments);
// depositor info is stored
bondInfo[_to].push(
Bond({
fragmentsReward: fragments,
vesting: terms.vestingTerm,
lastTime: uint32(block.timestamp),
maxTokenRewards: maxTokenRewards
})
);
if (!hasActiveBonds[_to]) {
hasActiveBonds[_to] = true;
userBondIndex[_to] = usersWithBonds.length;
usersWithBonds.push(_to);
}
// indexed events are emitted
emit BondCreated(
_to,
bondInfo[_to].length - 1,
fragments,
block.timestamp.add(terms.vestingTerm)
);
rebaser.rebase();
_processExpiredBonds();
return fragments;
}
function redeem(
address _recipient,
uint bid
) public nonReentrant returns (uint) {
Bond memory info = bondInfo[_recipient][bid];
require(info.fragmentsReward > 0, "NE");
uint percentVested = percentVestedFor(_recipient, bid);
require(msg.sender == _recipient || percentVested == BPS, "NA");
if (percentVested == BPS) {
// if fully vested
bondInfo[_recipient][bid] = bondInfo[_recipient][
getBondsLength(_recipient) - 1
];
bondInfo[_recipient].pop();
emit BondRedeemed(_recipient, bid, info.fragmentsReward, 0);
rebaser.rebase();
if (bondInfo[_recipient].length == 0) {
removeUserFromActiveList(_recipient);
}
return send(_recipient, info.fragmentsReward, info.maxTokenRewards); // pay user everything due
} else {
return 0;
}
}
function send(
address _recipient,
uint _amount,
uint _maxTokenRewards
) internal returns (uint) {
uint maxReservedFragments = (womo.tokenToFragment(_maxTokenRewards));
if (_amount > maxReservedFragments) {
womo.mintUnderlying(_recipient, _maxTokenRewards);
return maxReservedFragments;
} else {
womo.mint(_recipient, _amount);
return _amount;
}
}
function _processExpiredBonds() internal {
if (!autoClaimBonds) return;
uint256 totalUsers = usersWithBonds.length;
if (lastProcessedIndex >= totalUsers) {
lastProcessedIndex = 0;
}
uint256 endIndex = lastProcessedIndex + maxAutoClaimsPerTx;
if (endIndex > totalUsers) {
endIndex = totalUsers;
}
address[] memory usersToRemove = new address[](maxAutoClaimsPerTx);
uint256 usersToRemoveCount = 0;
for (uint256 i = lastProcessedIndex; i < endIndex; i++) {
address user = usersWithBonds[i];
uint256 bondsCount = bondInfo[user].length;
uint256 toProcess = bondsCount > maxAutoClaimsPerTx
? maxAutoClaimsPerTx
: bondsCount;
uint256 processed = 0;
uint256 bondIndex = bondsCount;
while (bondIndex > 0 && processed < toProcess) {
bondIndex--;
if (percentVestedFor(user, bondIndex) == BPS) {
_redeem(user, bondIndex);
processed++;
} else {
continue;
}
}
if (bondInfo[user].length == 0) {
usersToRemove[usersToRemoveCount] = user;
usersToRemoveCount++;
}
}
for (uint256 k = 0; k < usersToRemoveCount; k++) {
removeUserFromActiveList(usersToRemove[k]);
}
lastProcessedIndex = (endIndex >= totalUsers) ? 0 : endIndex;
}
function processExpiredBonds() public {
if (!autoClaimBonds) return;
rebaser.rebase();
uint256 totalUsers = usersWithBonds.length;
if (lastProcessedIndex >= totalUsers) {
lastProcessedIndex = 0;
}
uint256 endIndex = lastProcessedIndex + maxAutoClaimsPerTx;
if (endIndex > totalUsers) {
endIndex = totalUsers;
}
address[] memory usersToRemove = new address[](maxAutoClaimsPerTx);
uint256 usersToRemoveCount = 0;
for (uint256 i = lastProcessedIndex; i < endIndex; i++) {
address user = usersWithBonds[i];
uint256 bondsCount = bondInfo[user].length;
uint256 toProcess = bondsCount > maxAutoClaimsPerTx
? maxAutoClaimsPerTx
: bondsCount;
uint256 processed = 0;
uint256 bondIndex = bondsCount;
while (bondIndex > 0 && processed < toProcess) {
bondIndex--;
if (percentVestedFor(user, bondIndex) == BPS) {
_redeem(user, bondIndex);
processed++;
} else {
continue;
}
}
if (bondInfo[user].length == 0) {
usersToRemove[usersToRemoveCount] = user;
usersToRemoveCount++;
}
}
for (uint256 k = 0; k < usersToRemoveCount; k++) {
removeUserFromActiveList(usersToRemove[k]);
}
lastProcessedIndex = (endIndex >= totalUsers) ? 0 : endIndex;
}
function _redeem(address _recipient, uint bid) internal nonReentrant {
Bond memory info = bondInfo[_recipient][bid];
require(info.fragmentsReward > 0, "NE");
bondInfo[_recipient][bid] = bondInfo[_recipient][
getBondsLength(_recipient) - 1
];
bondInfo[_recipient].pop();
send(_recipient, info.fragmentsReward, info.maxTokenRewards);
}
function removeUserFromActiveList(address _user) internal {
hasActiveBonds[_user] = false;
uint256 index = userBondIndex[_user];
uint256 lastIndex = usersWithBonds.length - 1;
if (index != lastIndex) {
address lastUser = usersWithBonds[lastIndex];
usersWithBonds[index] = lastUser;
userBondIndex[lastUser] = index;
}
usersWithBonds.pop();
delete userBondIndex[_user];
}
function _debtCalculator(
uint _fragmentsReward
) internal returns (uint tokensRewardLimit) {
uint256 rebaseCount = terms.vestingTerm / rebaser.FRACTION_FACTOR();
uint256 compoundRatio = rebaser.compoundRatio();
uint256 scalingFactor = womo.tokensScalingFactor();
uint256 decayFactor = 1e18;
for (uint i = 0; i < rebaseCount; i++) {
decayFactor = (decayFactor * (1e18 - compoundRatio)) / 1e18;
}
uint256 futureScalingFactor = (scalingFactor * decayFactor) / 1e18;
tokensRewardLimit = (_fragmentsReward * 1e24) / futureScalingFactor;
require(reservesFragments >= _fragmentsReward, "BONDING ENDED");
reservesFragments -= _fragmentsReward;
return tokensRewardLimit;
}
function pendingPayoutFor(
address _depositor,
uint bid
) external view returns (uint pendingPayout_) {
uint percentVested = percentVestedFor(_depositor, bid);
uint fragments = bondInfo[_depositor][bid].fragmentsReward;
if (percentVested == BPS) {
pendingPayout_ = fragments;
} else {
pendingPayout_ = fragments.mul(percentVested) / BPS;
}
}
function percentVestedFor(
address _depositor,
uint bid
) public view returns (uint percentVested_) {
Bond memory bond = bondInfo[_depositor][bid];
uint secondsSinceLast = uint32(block.timestamp).sub32(bond.lastTime);
uint vesting = bond.vesting;
if (vesting > 0) {
percentVested_ = secondsSinceLast.mul(BPS) / vesting;
if (percentVested_ > BPS) percentVested_ = BPS;
} else {
percentVested_ = 0;
}
}
function setReserveFragments(uint256 amount) external onlyOwner {
uint256 currentSupply = womo.totalSupply();
if (currentSupply + amount > maxSupply) {
revert MaxSupplyExceeded();
}
reservesFragments = amount;
}
function setProcessExpiredBonds(bool _allowProcess) external onlyOwner {
autoClaimBonds = _allowProcess;
}
function getUserBond(
address user,
uint index
) external view returns (Bond memory) {
return bondInfo[user][index];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
/**
* @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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}// 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: UNLICENSE
pragma solidity >=0.5.0;
interface IRebaser {
function rebase() external;
function FRACTION_FACTOR() external view returns(uint);
function compoundRatio() external view returns(uint);
}//SPDX-License-Identifier: UNLICENSE
pragma solidity >=0.5.0;
interface IStaking {
function updateRewardPerInterval(uint256 _rewardPerInterval) external;
function deposit(uint256 _pid, uint256 _amount, address _account) external;
}//SPDX-License-Identifier: UNLICENSE
pragma solidity >=0.5.0;
interface ITreasury {
function deposit(
address _from,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
uint deadline
) external returns (uint fragments);
}//SPDX-License-Identifier: UNLICENSE
pragma solidity >=0.5.0;
interface IWomo {
function rebase(
uint256 epoch,
uint256 indexDelta,
bool positive
) external returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address user) external view returns (uint256);
function tokensScalingFactor() external view returns (uint256);
function mint(address to, uint256 amount) external;
function mintUnderlying(address to, uint256 amount) external;
function transferUnderlying(
address to,
uint256 value
) external returns (bool);
function fragmentToToken(uint256 value) external view returns (uint256);
function tokenToFragment(uint256 token) external view returns (uint256);
function balanceOfUnderlying(address who) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function approve(address to, uint amount) external;
function grantRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
pragma solidity =0.8.20;
library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
function add32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require((z = x + y) >= x);
}
/// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
}
function sub32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require((z = x - y) <= x);
}
/// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(x == 0 || (z = x * y) / x == y);
}
/// @notice Returns x + y, reverts if overflows or underflows
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x + y) >= x == (y >= 0));
}
/// @notice Returns x - y, reverts if overflows or underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x - y) <= x == (y >= 0));
}
}// SPDX-License-Identifier: MIT
pragma solidity =0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transferred
/// @param to The destination address of the transfer
/// @param value The amount to be transferred
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(
IERC20.transferFrom.selector,
from,
to,
value
)
);
require(
success && (data.length == 0 || abi.decode(data, (bool))),
"STF"
);
}
/// @notice Transfers tokens from msg.sender to a recipient
/// @dev Errors with ST if transfer fails
/// @param token The contract address of the token which will be transferred
/// @param to The recipient of the transfer
/// @param value The value of the transfer
function safeTransfer(address token, address to, uint256 value) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20.transfer.selector, to, value)
);
require(
success && (data.length == 0 || abi.decode(data, (bool))),
"ST"
);
}
/// @notice Approves the stipulated contract to spend the given allowance in the given token
/// @dev Errors with 'SA' if transfer fails
/// @param token The contract address of the token to be approved
/// @param to The target of the approval
/// @param value The amount of the given token the target will be allowed to spend
function safeApprove(address token, address to, uint256 value) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20.approve.selector, to, value)
);
require(
success && (data.length == 0 || abi.decode(data, (bool))),
"SA"
);
}
}{
"optimizer": {
"enabled": true,
"runs": 100
},
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ITreasury","name":"_treasury","type":"address"},{"internalType":"contract IWomo","name":"_womo","type":"address"},{"internalType":"contract IRebaser","name":"_rebaser","type":"address"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"MaxSupplyExceeded","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"AdditionalBipsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"bid","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"payout","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"BondCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"bid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"remaining","type":"uint256"}],"name":"BondRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"oldValue","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"newValue","type":"uint32"}],"name":"VestingTermChanged","type":"event"},{"inputs":[],"name":"BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"autoClaimBonds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"bondInfo","outputs":[{"internalType":"uint256","name":"fragmentsReward","type":"uint256"},{"internalType":"uint32","name":"vesting","type":"uint32"},{"internalType":"uint32","name":"lastTime","type":"uint32"},{"internalType":"uint256","name":"maxTokenRewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"amountDesiredA","type":"uint256"},{"internalType":"uint256","name":"amountDesiredB","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getBondsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getUserBond","outputs":[{"components":[{"internalType":"uint256","name":"fragmentsReward","type":"uint256"},{"internalType":"uint32","name":"vesting","type":"uint32"},{"internalType":"uint32","name":"lastTime","type":"uint32"},{"internalType":"uint256","name":"maxTokenRewards","type":"uint256"}],"internalType":"struct SafeHaven.Bond","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasActiveBonds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_additionalBips","type":"uint256"},{"internalType":"uint32","name":"_vestingTerm","type":"uint32"}],"name":"initializeSafeHavenTerms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastProcessedIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAutoClaimsPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_depositor","type":"address"},{"internalType":"uint256","name":"bid","type":"uint256"}],"name":"pendingPayoutFor","outputs":[{"internalType":"uint256","name":"pendingPayout_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_depositor","type":"address"},{"internalType":"uint256","name":"bid","type":"uint256"}],"name":"percentVestedFor","outputs":[{"internalType":"uint256","name":"percentVested_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"processExpiredBonds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rebaser","outputs":[{"internalType":"contract IRebaser","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"bid","type":"uint256"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reservesFragments","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bips","type":"uint256"}],"name":"setAdditionalBips","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_allowProcess","type":"bool"}],"name":"setProcessExpiredBonds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setReserveFragments","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_input","type":"uint32"}],"name":"setVestingTerm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"terms","outputs":[{"internalType":"uint256","name":"additionalBips","type":"uint256"},{"internalType":"uint32","name":"vestingTerm","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"contract ITreasury","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBondIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"usersWithBonds","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"womo","outputs":[{"internalType":"contract IWomo","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x60e03461012d57601f611dd738819003918201601f19168301916001600160401b038311848410176101315780849260809460405283398101031261012d5780516001600160a01b0391828216820361012d576020810151838116810361012d57604082015191848316830361012d5760600151925f543360018060a01b03198216175f55604051953391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a36001805560146003555f60045560805260a05260c052600160ff196002541617600255600655611c919081610146823960805181818161066f0152610bc0015260a0518181816102ac0152818161075501528181610c1f0152611440015260c0518181816106ce01528181610ea5015281816112e9015261181d0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60406080815260049081361015610014575f80fd5b5f91823560e01c806302e226ee14610ed457806311fd8a8314610e905780631e9a695014610e54578063249d39e914610e375780632628303014610dab5780633009a60914610d8e5780633796c67e14610d1f5780633954ac9014610d005780634e23e00814610cc257806356e29d4314610bef57806361d027b314610bab5780636cfa2293146105fa5780636e979c6a146105ca578063715018a61461057057806373dfe2e8146105385780638ad59c70146104bf5780638da5cb5b1461049757806391df741a1461045f5780639635e1871461040b5780639f250bdf146103d4578063a06a0c16146103b5578063b4879beb14610399578063b6c8d1de14610359578063c3376b53146102db578063c899bb4814610297578063cee49d3614610273578063d502562514610245578063d5abeb01146102225763f2fde38b1461015d575f80fd5b3461021e57602036600319011261021e57610176610f50565b9061017f610faf565b6001600160a01b039182169283156101cc57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b5050346102415781600319360112610241576020906006549051908152f35b5080fd5b82843461027057806003193601126102705750600b5463ffffffff600c541682519182526020820152f35b80fd5b50503461024157816003193601126102415760209060ff6002541690519015158152f35b505034610241578160031936011261024157517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461021e578160031936011261021e576024359163ffffffff831680930361035557610306610faf565b6103156201fa40841015611006565b67ffffffffffffffff81519182019182109111176103425735600b5563ffffffff19600c541617600c5580f35b634e487b7160e01b835260419052602482fd5b8380fd5b503461021e57602036600319011261021e573591600a548310156102705750610383602092610f97565b905491519160018060a01b039160031b1c168152f35b83346102705780600319360112610270576103b261180e565b80f35b5050346102415781600319360112610241576020906005549051908152f35b8382346102415760203660031901126102415735801515809103610241576103fa610faf565b60ff80196002541691161760025580f35b50903461021e57602036600319011261021e577fab01330f64b0d6560c371a343d2a3136edbeff737e10e4d5590b6433446f16919135610449610faf565b600b549080600b5582519182526020820152a180f35b5050346102415760203660031901126102415760209181906001600160a01b03610487610f50565b1681526009845220549051908152f35b505034610241578160031936011261024157905490516001600160a01b039091168152602090f35b5050346102415780600319360112610241576104d9610f50565b6001600160a01b03168252600760205280822080546024359390841015610270575060809261050791610f6a565b508054916002600183015492015491815193845263ffffffff90818116602086015260201c16908301526060820152f35b5050346102415760203660031901126102415760209181906001600160a01b03610560610f50565b1681526007845220549051908152f35b8334610270578060031936011261027057610589610faf565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5050346102415780600319360112610241576020906105f36105ea610f50565b60243590611b77565b9051908152f35b50903461021e5760c036600319011261021e57610615610f50565b926001600160a01b03808516938415610b7657835194636cfa229360e01b8652338287015260249081358288015260443560448801526064356064880152608435608488015260a43560a4880152602097888860c48189897f0000000000000000000000000000000000000000000000000000000000000000165af1978815610b6c578698610b3d575b506106b96127106106b2600b548b611c24565b0489611563565b9788106109525763ffffffff9081600c5416867f0000000000000000000000000000000000000000000000000000000000000000169689516326c894f560e01b81528c8189818c5afa8015610b33578a90610b00575b61071a9150836110c4565b8a51630d295ea760e41b8152918d838a818d5afa928315610ac2578992918f918d95610acc575b508d51630518c43760e21b815293849182907f0000000000000000000000000000000000000000000000000000000000000000165afa918215610ac2578b92610a8f575b5091670de0b6b3a7640000928b915b818310610a3b57505050670de0b6b3a7640000916107b191611b64565b0469d3c21bcecceda1000000808c02908c8204148c1517156109f657906107d7916110c4565b906005548b8110610a08578b81039081116109f65760055584895260078c52898920918a51916108068361105e565b8c83528d83019081524286168c8401908152606084019283528454600160401b95868210156109e4579061083f91600182018155610f6a565b9490946109d35791876108889260029594518755816001880193511663ffffffff19845416178355511663ffffffff60201b82549160201b169063ffffffff60201b1916179055565b5191015583885260088b52888820805460ff811615610967575b5050508287525060078952868620545f1981019390841161095657506108cc90600c541642611563565b9142831061095257907fbbd0a796e53fc04bdfea44e3c13d5e0de09d09446782b6b50e766a1b050b6a2d8989938951908152a4813b1561021e5782918291855180958193632bc5014b60e21b83525af19081156109475750610938575b506109326115fc565b51908152f35b6109419061108e565b5f610929565b8351903d90823e3d90fd5b8580fd5b634e487b7160e01b87526011855286fd5b60ff19166001179055600a5460098c52898920819055908110156109c157906109998260016109b89401600a55610f97565b90919082549060031b9160018060a01b03809116831b921b1916179055565b5f8080806108a2565b634e487b7160e01b8852604186528488fd5b634e487b7160e01b8d528c8b52898dfd5b634e487b7160e01b8e5260418c528a8efd5b634e487b7160e01b8a5260118852868afd5b50895162461bcd60e51b81528088018d9052600d818801526c1093d391125391c81153911151609a1b6044820152606490fd5b90919381670de0b6b3a76400000390670de0b6b3a76400008211610a7d57610a6f610a7692670de0b6b3a764000092611b64565b04946115ce565b9190610794565b634e487b7160e01b8e5260118c528a8efd5b9091508d81813d8311610abb575b610aa781836110a2565b81010312610ab75751905f610785565b8a80fd5b503d610a9d565b8c513d8d823e3d90fd5b929350935081813d8311610af9575b610ae581836110a2565b81010312610ab757908d899251935f610741565b503d610adb565b508c81813d8311610b2c575b610b1681836110a2565b81010312610b285761071a905161070f565b8980fd5b503d610b0c565b8b513d8c823e3d90fd5b9097508881813d8311610b65575b610b5581836110a2565b810103126109525751965f61069f565b503d610b4b565b87513d88823e3d90fd5b606490602085519162461bcd60e51b8352820152600f60248201526e496e76616c6964206164647265737360881b6044820152fd5b505034610241578160031936011261024157517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461021e57602036600319011261021e57803591610c0c610faf565b80516318160ddd60e01b815260208184817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610cb85784908690610c7f575b610c629250611563565b60065410610c7257505060055580f35b51638a164f6360e01b8152fd5b50506020813d8211610cb0575b81610c99602093836110a2565b81010312610cac5783610c629151610c58565b8480fd5b3d9150610c8c565b82513d87823e3d90fd5b5050346102415760203660031901126102415760209160ff9082906001600160a01b03610ced610f50565b1681526008855220541690519015158152f35b5050346102415781600319360112610241576020906003549051908152f35b505034610241578060031936011261024157602091610d66610d3f610f50565b918360243591610d4f8386611b77565b6001600160a01b0390951681526007875220610f6a565b50549061271090818103610d7d5750509051908152f35b610d879192611c24565b0490610932565b503461021e578260031936011261021e5760209250549051908152f35b5050346102415780600319360112610241576060610e0d610e07608094610dd0610f50565b81858751610ddd8161105e565b8281528260208201528289820152015260018060a01b031681526007602052846024359120610f6a565b506110e2565b8251928151845263ffffffff80602084015116602086015281830151169084015201516060820152f35b505034610241578160031936011261024157602090516127108152f35b505034610241578060031936011261024157602090610e85610e74610f50565b610e7c6113d2565b60243590611205565b906001805551908152f35b505034610241578160031936011261024157517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461021e57602036600319011261021e57359063ffffffff808316809303610355577f56070ac8d1c0d69f3642a4cfaddadfb7a3881ab1b8d8ba6ae19a3312b0f0a43192610f21610faf565b610f306201fa40821015611006565b600c54918163ffffffff19841617600c558351921682526020820152a180f35b600435906001600160a01b0382168203610f6657565b5f80fd5b8054821015610f83575f52600360205f20910201905f90565b634e487b7160e01b5f52603260045260245ffd5b600a54811015610f8357600a5f5260205f2001905f90565b5f546001600160a01b03163303610fc257565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561100d57565b60405162461bcd60e51b8152602060048201526024808201527f56657374696e67206d757374206265206c6f6e676572207468616e20333620686044820152636f75727360e01b6064820152608490fd5b6080810190811067ffffffffffffffff82111761107a57604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161107a57604052565b90601f8019910116810190811067ffffffffffffffff82111761107a57604052565b81156110ce570490565b634e487b7160e01b5f52601260045260245ffd5b906040516110ef8161105e565b60606002829480548452600181015463ffffffff90818116602087015260201c1660408501520154910152565b1561112357565b60405162461bcd60e51b81526020600482015260026024820152614e4560f01b6044820152606490fd5b91906111b25780820361115e575050565b60028181925484556111ab600185016001830163ffffffff908181541663ffffffff198454161783555460201c1663ffffffff60201b82549160201b169063ffffffff60201b1916179055565b0154910155565b634e487b7160e01b5f525f60045260245ffd5b805480156111f1575f1901906111db8282610f6a565b6111b2576002815f809355826001820155015555565b634e487b7160e01b5f52603160045260245ffd5b9190915f9260018060a01b0380831680865260206007815260409261122f610e0786868b20610f6a565b9461123c8651151561111c565b6112468188611b77565b84331480156113c7575b1561139e5761271003611395578389526007835284892080545f198101919082116113815760608b9594936112c46112aa89957f1ed7ee1a43efec4a4f81e0d29338046bc1b1f4f035f86d69176f2d3518baae8b95610f6a565b50858952600788526112be838c8b20610f6a565b9061114d565b838752600786526112d68988206111c5565b89518951918252868201528689820152a27f000000000000000000000000000000000000000000000000000000000000000016803b1561021e57829060048651809b8193632bc5014b60e21b83525af1978815611377576113549798611365575b5081926007925252205415611357575b6060815191015191611428565b90565b61136082611a8c565b611347565b9161137160079361108e565b91611337565b84513d84823e3d90fd5b634e487b7160e01b8b52601160045260248bfd5b50505050505050565b855162461bcd60e51b81526004810185905260026024820152614e4160f01b6044820152606490fd5b506127108114611250565b6002600154146113e3576002600155565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b60408051637ed04be360e11b815260048101859052937f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031693919291602086602481885afa958615611559575f96611526575b50858111156114e85750833b15610f6657825163245d417d60e21b81526001600160a01b0390921660048301526024820152915f908390818381604481015b03925af19081156114df57506114d6575090565b6113549061108e565b513d5f823e3d90fd5b94505091803b15610f665781516340c10f1960e01b81526001600160a01b039093166004840152602483018490525f908390818381604481016114c2565b90956020823d8211611551575b81611540602093836110a2565b81010312610270575051945f611483565b3d9150611533565b84513d5f823e3d90fd5b9190820180921161157057565b634e487b7160e01b5f52601160045260245ffd5b67ffffffffffffffff811161107a5760051b60200190565b906115a682611584565b6115b360405191826110a2565b82815280926115c4601f1991611584565b0190602036910137565b5f1981146115705760010190565b8015611570575f190190565b8051821015610f835760209160051b010190565b60ff600254161561180c57600a54806004541015611803575b60045490600354916116278382611563565b928284116117f9575b6116399061159c565b5f915b84811061168c57505f5b82811061166257505050811061165d57505f600455565b600455565b611687906116826001600160a01b0361167b83866115e8565b5116611a8c565b6115ce565b611646565b9192909461169983610f97565b60018060a01b0391549060031b1c1692835f52600796602095888752604094855f2054946003548087115f146117ee57999591955b5f925b801515806117e5575b1561179b576116e8906115dc565b926127106116f6858c611b77565b03611795576117036113d2565b895f528c8b52611718610e07858b5f20610f6a565b906117258251151561111c565b8a5f528d8c52895f208054925f198401938411611570578f8e8e6117668f6112be8c61175761178c9b6117829a610f6a565b5092855f528787525f20610f6a565b5f52526117748c5f206111c5565b60608151910151908d611428565b50600180556115ce565b965b96926116d1565b9661178e565b5099509991969394979050949194835f52525f2054156117c5575b506117c0906115ce565b61163c565b836117de916117d86117c09496866115e8565b526115ce565b92906117b6565b508b84106116da565b5085999591956116ce565b9192508291611630565b5f600455611615565b565b60025460ff5f911615611a89577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316803b15610241578190816040518092632bc5014b60e21b82528160049687925af18015611a7e57611a6f575b50600a548083541015611a67575b825490600354916118908382611563565b92828411611a5d575b6118a29061159c565b84915b8481106118e85750845b8281106118ca5750505081106118c457509055565b90509055565b6118e3906116826001600160a01b0361167b83866115e8565b6118af565b916118f883989496959798610f97565b9054600391821b1c6001600160a01b0316808752600760205260408720549154909791959080871115611a5257989591955b87925b80151580611a49575b15611a0257611944906115dc565b92612710611952858c611b77565b036119fc5761195f6113d2565b8989526007602052611977610e078560408c20610f6a565b6119838151151561111c565b8a8a52600760205260408a208054805f198101116119e957916119cc8d6112be898f6040906119bd611782986119e09b9a5f190190610f6a565b50948152600760205220610f6a565b8c8c52600760205261177460408d206111c5565b965b969261192d565b634e487b7160e01b8c5260118f5260248cfd5b966119e2565b50969791509897509290928087526007602052604087205415611a2f575b50611a2a906115ce565b6118a5565b83611a42916117d8611a2a9496866115e8565b9290611a20565b508a8410611936565b50859895919561192a565b9192508291611899565b81835561187f565b611a789061108e565b5f611871565b6040513d84823e3d90fd5b50565b6001600160a01b039081165f818152600860209081526040808320805460ff191690556009909152812054600a549193915f199190828101908111611b50578084918303611b1e575b505050600a548015611b0a570190611aec82610f97565b909182549160031b1b19169055600a55815260096020526040812055565b634e487b7160e01b85526031600452602485fd5b611b2790610f97565b90549060031b1c16611b3c8161099984610f97565b8552600960205260408520555f8281611ad5565b634e487b7160e01b86526011600452602486fd5b8181029291811591840414171561157057565b6001600160a01b03165f908152600760205260408120909291611b9e91610e079190610f6a565b63ffffffff80421691816040820151168303828111611b50578216928311610cac576020015116908115611c205783908015908115611bfb575b501561035557611be99293506110c4565b90612710808311611bf75750565b9150565b61271080820293509181840483141715611b5057611c1990836110c4565b145f611bd8565b5050565b91905f928015918215611c3b575b505015610f6657565b91509250611c53611c4c8285611b64565b93846110c4565b145f80611c3256fea264697066735822122011a804165bc72a7deb7ce430a54b7de4224403b854cee5878633a311ca899d9664736f6c634300081400330000000000000000000000001213f05218df835b2d233b2a6e514ec2e63376070000000000000000000000003e08cb3067dc198fc313e1789347c9ae72c079d4000000000000000000000000149544149c7cff52e1e98673109b05cd3c2e18630000000000000000000000000000000000000000033b2e3c9fd0803ce8000000
Deployed Bytecode
0x60406080815260049081361015610014575f80fd5b5f91823560e01c806302e226ee14610ed457806311fd8a8314610e905780631e9a695014610e54578063249d39e914610e375780632628303014610dab5780633009a60914610d8e5780633796c67e14610d1f5780633954ac9014610d005780634e23e00814610cc257806356e29d4314610bef57806361d027b314610bab5780636cfa2293146105fa5780636e979c6a146105ca578063715018a61461057057806373dfe2e8146105385780638ad59c70146104bf5780638da5cb5b1461049757806391df741a1461045f5780639635e1871461040b5780639f250bdf146103d4578063a06a0c16146103b5578063b4879beb14610399578063b6c8d1de14610359578063c3376b53146102db578063c899bb4814610297578063cee49d3614610273578063d502562514610245578063d5abeb01146102225763f2fde38b1461015d575f80fd5b3461021e57602036600319011261021e57610176610f50565b9061017f610faf565b6001600160a01b039182169283156101cc57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b5050346102415781600319360112610241576020906006549051908152f35b5080fd5b82843461027057806003193601126102705750600b5463ffffffff600c541682519182526020820152f35b80fd5b50503461024157816003193601126102415760209060ff6002541690519015158152f35b505034610241578160031936011261024157517f0000000000000000000000003e08cb3067dc198fc313e1789347c9ae72c079d46001600160a01b03168152602090f35b503461021e578160031936011261021e576024359163ffffffff831680930361035557610306610faf565b6103156201fa40841015611006565b67ffffffffffffffff81519182019182109111176103425735600b5563ffffffff19600c541617600c5580f35b634e487b7160e01b835260419052602482fd5b8380fd5b503461021e57602036600319011261021e573591600a548310156102705750610383602092610f97565b905491519160018060a01b039160031b1c168152f35b83346102705780600319360112610270576103b261180e565b80f35b5050346102415781600319360112610241576020906005549051908152f35b8382346102415760203660031901126102415735801515809103610241576103fa610faf565b60ff80196002541691161760025580f35b50903461021e57602036600319011261021e577fab01330f64b0d6560c371a343d2a3136edbeff737e10e4d5590b6433446f16919135610449610faf565b600b549080600b5582519182526020820152a180f35b5050346102415760203660031901126102415760209181906001600160a01b03610487610f50565b1681526009845220549051908152f35b505034610241578160031936011261024157905490516001600160a01b039091168152602090f35b5050346102415780600319360112610241576104d9610f50565b6001600160a01b03168252600760205280822080546024359390841015610270575060809261050791610f6a565b508054916002600183015492015491815193845263ffffffff90818116602086015260201c16908301526060820152f35b5050346102415760203660031901126102415760209181906001600160a01b03610560610f50565b1681526007845220549051908152f35b8334610270578060031936011261027057610589610faf565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5050346102415780600319360112610241576020906105f36105ea610f50565b60243590611b77565b9051908152f35b50903461021e5760c036600319011261021e57610615610f50565b926001600160a01b03808516938415610b7657835194636cfa229360e01b8652338287015260249081358288015260443560448801526064356064880152608435608488015260a43560a4880152602097888860c48189897f0000000000000000000000001213f05218df835b2d233b2a6e514ec2e6337607165af1978815610b6c578698610b3d575b506106b96127106106b2600b548b611c24565b0489611563565b9788106109525763ffffffff9081600c5416867f000000000000000000000000149544149c7cff52e1e98673109b05cd3c2e1863169689516326c894f560e01b81528c8189818c5afa8015610b33578a90610b00575b61071a9150836110c4565b8a51630d295ea760e41b8152918d838a818d5afa928315610ac2578992918f918d95610acc575b508d51630518c43760e21b815293849182907f0000000000000000000000003e08cb3067dc198fc313e1789347c9ae72c079d4165afa918215610ac2578b92610a8f575b5091670de0b6b3a7640000928b915b818310610a3b57505050670de0b6b3a7640000916107b191611b64565b0469d3c21bcecceda1000000808c02908c8204148c1517156109f657906107d7916110c4565b906005548b8110610a08578b81039081116109f65760055584895260078c52898920918a51916108068361105e565b8c83528d83019081524286168c8401908152606084019283528454600160401b95868210156109e4579061083f91600182018155610f6a565b9490946109d35791876108889260029594518755816001880193511663ffffffff19845416178355511663ffffffff60201b82549160201b169063ffffffff60201b1916179055565b5191015583885260088b52888820805460ff811615610967575b5050508287525060078952868620545f1981019390841161095657506108cc90600c541642611563565b9142831061095257907fbbd0a796e53fc04bdfea44e3c13d5e0de09d09446782b6b50e766a1b050b6a2d8989938951908152a4813b1561021e5782918291855180958193632bc5014b60e21b83525af19081156109475750610938575b506109326115fc565b51908152f35b6109419061108e565b5f610929565b8351903d90823e3d90fd5b8580fd5b634e487b7160e01b87526011855286fd5b60ff19166001179055600a5460098c52898920819055908110156109c157906109998260016109b89401600a55610f97565b90919082549060031b9160018060a01b03809116831b921b1916179055565b5f8080806108a2565b634e487b7160e01b8852604186528488fd5b634e487b7160e01b8d528c8b52898dfd5b634e487b7160e01b8e5260418c528a8efd5b634e487b7160e01b8a5260118852868afd5b50895162461bcd60e51b81528088018d9052600d818801526c1093d391125391c81153911151609a1b6044820152606490fd5b90919381670de0b6b3a76400000390670de0b6b3a76400008211610a7d57610a6f610a7692670de0b6b3a764000092611b64565b04946115ce565b9190610794565b634e487b7160e01b8e5260118c528a8efd5b9091508d81813d8311610abb575b610aa781836110a2565b81010312610ab75751905f610785565b8a80fd5b503d610a9d565b8c513d8d823e3d90fd5b929350935081813d8311610af9575b610ae581836110a2565b81010312610ab757908d899251935f610741565b503d610adb565b508c81813d8311610b2c575b610b1681836110a2565b81010312610b285761071a905161070f565b8980fd5b503d610b0c565b8b513d8c823e3d90fd5b9097508881813d8311610b65575b610b5581836110a2565b810103126109525751965f61069f565b503d610b4b565b87513d88823e3d90fd5b606490602085519162461bcd60e51b8352820152600f60248201526e496e76616c6964206164647265737360881b6044820152fd5b505034610241578160031936011261024157517f0000000000000000000000001213f05218df835b2d233b2a6e514ec2e63376076001600160a01b03168152602090f35b503461021e57602036600319011261021e57803591610c0c610faf565b80516318160ddd60e01b815260208184817f0000000000000000000000003e08cb3067dc198fc313e1789347c9ae72c079d46001600160a01b03165afa8015610cb85784908690610c7f575b610c629250611563565b60065410610c7257505060055580f35b51638a164f6360e01b8152fd5b50506020813d8211610cb0575b81610c99602093836110a2565b81010312610cac5783610c629151610c58565b8480fd5b3d9150610c8c565b82513d87823e3d90fd5b5050346102415760203660031901126102415760209160ff9082906001600160a01b03610ced610f50565b1681526008855220541690519015158152f35b5050346102415781600319360112610241576020906003549051908152f35b505034610241578060031936011261024157602091610d66610d3f610f50565b918360243591610d4f8386611b77565b6001600160a01b0390951681526007875220610f6a565b50549061271090818103610d7d5750509051908152f35b610d879192611c24565b0490610932565b503461021e578260031936011261021e5760209250549051908152f35b5050346102415780600319360112610241576060610e0d610e07608094610dd0610f50565b81858751610ddd8161105e565b8281528260208201528289820152015260018060a01b031681526007602052846024359120610f6a565b506110e2565b8251928151845263ffffffff80602084015116602086015281830151169084015201516060820152f35b505034610241578160031936011261024157602090516127108152f35b505034610241578060031936011261024157602090610e85610e74610f50565b610e7c6113d2565b60243590611205565b906001805551908152f35b505034610241578160031936011261024157517f000000000000000000000000149544149c7cff52e1e98673109b05cd3c2e18636001600160a01b03168152602090f35b503461021e57602036600319011261021e57359063ffffffff808316809303610355577f56070ac8d1c0d69f3642a4cfaddadfb7a3881ab1b8d8ba6ae19a3312b0f0a43192610f21610faf565b610f306201fa40821015611006565b600c54918163ffffffff19841617600c558351921682526020820152a180f35b600435906001600160a01b0382168203610f6657565b5f80fd5b8054821015610f83575f52600360205f20910201905f90565b634e487b7160e01b5f52603260045260245ffd5b600a54811015610f8357600a5f5260205f2001905f90565b5f546001600160a01b03163303610fc257565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561100d57565b60405162461bcd60e51b8152602060048201526024808201527f56657374696e67206d757374206265206c6f6e676572207468616e20333620686044820152636f75727360e01b6064820152608490fd5b6080810190811067ffffffffffffffff82111761107a57604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161107a57604052565b90601f8019910116810190811067ffffffffffffffff82111761107a57604052565b81156110ce570490565b634e487b7160e01b5f52601260045260245ffd5b906040516110ef8161105e565b60606002829480548452600181015463ffffffff90818116602087015260201c1660408501520154910152565b1561112357565b60405162461bcd60e51b81526020600482015260026024820152614e4560f01b6044820152606490fd5b91906111b25780820361115e575050565b60028181925484556111ab600185016001830163ffffffff908181541663ffffffff198454161783555460201c1663ffffffff60201b82549160201b169063ffffffff60201b1916179055565b0154910155565b634e487b7160e01b5f525f60045260245ffd5b805480156111f1575f1901906111db8282610f6a565b6111b2576002815f809355826001820155015555565b634e487b7160e01b5f52603160045260245ffd5b9190915f9260018060a01b0380831680865260206007815260409261122f610e0786868b20610f6a565b9461123c8651151561111c565b6112468188611b77565b84331480156113c7575b1561139e5761271003611395578389526007835284892080545f198101919082116113815760608b9594936112c46112aa89957f1ed7ee1a43efec4a4f81e0d29338046bc1b1f4f035f86d69176f2d3518baae8b95610f6a565b50858952600788526112be838c8b20610f6a565b9061114d565b838752600786526112d68988206111c5565b89518951918252868201528689820152a27f000000000000000000000000149544149c7cff52e1e98673109b05cd3c2e186316803b1561021e57829060048651809b8193632bc5014b60e21b83525af1978815611377576113549798611365575b5081926007925252205415611357575b6060815191015191611428565b90565b61136082611a8c565b611347565b9161137160079361108e565b91611337565b84513d84823e3d90fd5b634e487b7160e01b8b52601160045260248bfd5b50505050505050565b855162461bcd60e51b81526004810185905260026024820152614e4160f01b6044820152606490fd5b506127108114611250565b6002600154146113e3576002600155565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b60408051637ed04be360e11b815260048101859052937f0000000000000000000000003e08cb3067dc198fc313e1789347c9ae72c079d46001600160a01b031693919291602086602481885afa958615611559575f96611526575b50858111156114e85750833b15610f6657825163245d417d60e21b81526001600160a01b0390921660048301526024820152915f908390818381604481015b03925af19081156114df57506114d6575090565b6113549061108e565b513d5f823e3d90fd5b94505091803b15610f665781516340c10f1960e01b81526001600160a01b039093166004840152602483018490525f908390818381604481016114c2565b90956020823d8211611551575b81611540602093836110a2565b81010312610270575051945f611483565b3d9150611533565b84513d5f823e3d90fd5b9190820180921161157057565b634e487b7160e01b5f52601160045260245ffd5b67ffffffffffffffff811161107a5760051b60200190565b906115a682611584565b6115b360405191826110a2565b82815280926115c4601f1991611584565b0190602036910137565b5f1981146115705760010190565b8015611570575f190190565b8051821015610f835760209160051b010190565b60ff600254161561180c57600a54806004541015611803575b60045490600354916116278382611563565b928284116117f9575b6116399061159c565b5f915b84811061168c57505f5b82811061166257505050811061165d57505f600455565b600455565b611687906116826001600160a01b0361167b83866115e8565b5116611a8c565b6115ce565b611646565b9192909461169983610f97565b60018060a01b0391549060031b1c1692835f52600796602095888752604094855f2054946003548087115f146117ee57999591955b5f925b801515806117e5575b1561179b576116e8906115dc565b926127106116f6858c611b77565b03611795576117036113d2565b895f528c8b52611718610e07858b5f20610f6a565b906117258251151561111c565b8a5f528d8c52895f208054925f198401938411611570578f8e8e6117668f6112be8c61175761178c9b6117829a610f6a565b5092855f528787525f20610f6a565b5f52526117748c5f206111c5565b60608151910151908d611428565b50600180556115ce565b965b96926116d1565b9661178e565b5099509991969394979050949194835f52525f2054156117c5575b506117c0906115ce565b61163c565b836117de916117d86117c09496866115e8565b526115ce565b92906117b6565b508b84106116da565b5085999591956116ce565b9192508291611630565b5f600455611615565b565b60025460ff5f911615611a89577f000000000000000000000000149544149c7cff52e1e98673109b05cd3c2e18636001600160a01b0316803b15610241578190816040518092632bc5014b60e21b82528160049687925af18015611a7e57611a6f575b50600a548083541015611a67575b825490600354916118908382611563565b92828411611a5d575b6118a29061159c565b84915b8481106118e85750845b8281106118ca5750505081106118c457509055565b90509055565b6118e3906116826001600160a01b0361167b83866115e8565b6118af565b916118f883989496959798610f97565b9054600391821b1c6001600160a01b0316808752600760205260408720549154909791959080871115611a5257989591955b87925b80151580611a49575b15611a0257611944906115dc565b92612710611952858c611b77565b036119fc5761195f6113d2565b8989526007602052611977610e078560408c20610f6a565b6119838151151561111c565b8a8a52600760205260408a208054805f198101116119e957916119cc8d6112be898f6040906119bd611782986119e09b9a5f190190610f6a565b50948152600760205220610f6a565b8c8c52600760205261177460408d206111c5565b965b969261192d565b634e487b7160e01b8c5260118f5260248cfd5b966119e2565b50969791509897509290928087526007602052604087205415611a2f575b50611a2a906115ce565b6118a5565b83611a42916117d8611a2a9496866115e8565b9290611a20565b508a8410611936565b50859895919561192a565b9192508291611899565b81835561187f565b611a789061108e565b5f611871565b6040513d84823e3d90fd5b50565b6001600160a01b039081165f818152600860209081526040808320805460ff191690556009909152812054600a549193915f199190828101908111611b50578084918303611b1e575b505050600a548015611b0a570190611aec82610f97565b909182549160031b1b19169055600a55815260096020526040812055565b634e487b7160e01b85526031600452602485fd5b611b2790610f97565b90549060031b1c16611b3c8161099984610f97565b8552600960205260408520555f8281611ad5565b634e487b7160e01b86526011600452602486fd5b8181029291811591840414171561157057565b6001600160a01b03165f908152600760205260408120909291611b9e91610e079190610f6a565b63ffffffff80421691816040820151168303828111611b50578216928311610cac576020015116908115611c205783908015908115611bfb575b501561035557611be99293506110c4565b90612710808311611bf75750565b9150565b61271080820293509181840483141715611b5057611c1990836110c4565b145f611bd8565b5050565b91905f928015918215611c3b575b505015610f6657565b91509250611c53611c4c8285611b64565b93846110c4565b145f80611c3256fea264697066735822122011a804165bc72a7deb7ce430a54b7de4224403b854cee5878633a311ca899d9664736f6c63430008140033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.