Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Latest 25 from a total of 228 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Claim Bribes | 24449252 | 8 days ago | IN | 0 ETH | 0.00027182 | ||||
| Claim Bribes | 24405213 | 14 days ago | IN | 0 ETH | 0.00001715 | ||||
| Claim Bribes | 24400321 | 15 days ago | IN | 0 ETH | 0.00034801 | ||||
| Claim Bribes | 24397102 | 16 days ago | IN | 0 ETH | 0.00016386 | ||||
| Transfer Ownersh... | 24392492 | 16 days ago | IN | 0 ETH | 0.00008554 | ||||
| Claim Bribes | 24375711 | 19 days ago | IN | 0 ETH | 0.00001408 | ||||
| Claim Bribes | 24368260 | 20 days ago | IN | 0 ETH | 0.00016701 | ||||
| Claim Bribes | 24338030 | 24 days ago | IN | 0 ETH | 0.00000826 | ||||
| Claim Bribes | 24330561 | 25 days ago | IN | 0 ETH | 0.00006438 | ||||
| Claim Bribes | 24292280 | 30 days ago | IN | 0 ETH | 0.00010897 | ||||
| Claim Bribes | 24261139 | 35 days ago | IN | 0 ETH | 0.00000293 | ||||
| Claim Bribes | 24207471 | 42 days ago | IN | 0 ETH | 0.00002029 | ||||
| Claim Bribes | 24201593 | 43 days ago | IN | 0 ETH | 0.00065201 | ||||
| Claim Bribes | 24196294 | 44 days ago | IN | 0 ETH | 0.00002914 | ||||
| Claim Bribes | 24175381 | 47 days ago | IN | 0 ETH | 0.00049424 | ||||
| Claim Bribes | 24172148 | 47 days ago | IN | 0 ETH | 0.00005993 | ||||
| Claim Bribes | 24156896 | 49 days ago | IN | 0 ETH | 0.00210493 | ||||
| Claim Bribes | 24142391 | 51 days ago | IN | 0 ETH | 0.00004584 | ||||
| Claim Bribes | 24141024 | 51 days ago | IN | 0 ETH | 0.00006494 | ||||
| Claim Bribes | 24130083 | 53 days ago | IN | 0 ETH | 0.00000687 | ||||
| Claim Bribes | 24101270 | 57 days ago | IN | 0 ETH | 0.00023583 | ||||
| Claim Bribes | 24101094 | 57 days ago | IN | 0 ETH | 0.00001938 | ||||
| Claim Bribes | 24091252 | 58 days ago | IN | 0 ETH | 0.0000357 | ||||
| Claim Bribes | 24086014 | 59 days ago | IN | 0 ETH | 0.00000477 | ||||
| Claim Bribes | 24070899 | 61 days ago | IN | 0 ETH | 0.00030348 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
EkuboInitiative
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 100000 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {BribeInitiative} from "./BribeInitiative.sol";
import {Ownable} from "openzeppelin/contracts/access/Ownable.sol";
contract EkuboInitiative is BribeInitiative, Ownable {
event BoldRewardsReceived(uint256 indexed epoch, uint256 amount);
constructor(address _governance, address _bold, address _bribeToken)
BribeInitiative(_governance, _bold, _bribeToken)
Ownable(msg.sender)
{}
/// @notice Governance transfers BOLD, and we transfer it to the initiative owner
function onClaimForInitiative(uint256 epoch, uint256 boldAmount) external override onlyGovernance {
bold.transfer(owner(), boldAmount);
emit BoldRewardsReceived(epoch, boldAmount);
}
/// @notice Ownable exec. function
function exec(address to, uint256 value, bytes calldata data) external payable onlyOwner {
(bool ok,) = to.call{value: value}(data);
require(ok, "Call failed");
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {IERC20} from "openzeppelin/contracts/interfaces/IERC20.sol";
import {SafeERC20} from "openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IGovernance, UNREGISTERED_INITIATIVE} from "./interfaces/IGovernance.sol";
import {IInitiative} from "./interfaces/IInitiative.sol";
import {IBribeInitiative} from "./interfaces/IBribeInitiative.sol";
import {DoubleLinkedList} from "./utils/DoubleLinkedList.sol";
import {_lqtyToVotes} from "./utils/VotingPower.sol";
contract BribeInitiative is IInitiative, IBribeInitiative {
using SafeERC20 for IERC20;
using DoubleLinkedList for DoubleLinkedList.List;
uint256 internal immutable EPOCH_START;
uint256 internal immutable EPOCH_DURATION;
/// @inheritdoc IBribeInitiative
IGovernance public immutable governance;
/// @inheritdoc IBribeInitiative
IERC20 public immutable bold;
/// @inheritdoc IBribeInitiative
IERC20 public immutable bribeToken;
/// @inheritdoc IBribeInitiative
mapping(uint256 => Bribe) public bribeByEpoch;
/// @inheritdoc IBribeInitiative
mapping(address => mapping(uint256 => bool)) public claimedBribeAtEpoch;
/// Double linked list of the total LQTY allocated at a given epoch
DoubleLinkedList.List internal totalLQTYAllocationByEpoch;
/// Double linked list of LQTY allocated by a user at a given epoch
mapping(address => DoubleLinkedList.List) internal lqtyAllocationByUserAtEpoch;
constructor(address _governance, address _bold, address _bribeToken) {
require(_bribeToken != _bold, "BribeInitiative: bribe-token-cannot-be-bold");
governance = IGovernance(_governance);
bold = IERC20(_bold);
bribeToken = IERC20(_bribeToken);
EPOCH_START = governance.EPOCH_START();
EPOCH_DURATION = governance.EPOCH_DURATION();
}
modifier onlyGovernance() {
require(msg.sender == address(governance), "BribeInitiative: invalid-sender");
_;
}
/// @inheritdoc IBribeInitiative
function totalLQTYAllocatedByEpoch(uint256 _epoch) external view returns (uint256, uint256) {
return (totalLQTYAllocationByEpoch.items[_epoch].lqty, totalLQTYAllocationByEpoch.items[_epoch].offset);
}
/// @inheritdoc IBribeInitiative
function lqtyAllocatedByUserAtEpoch(address _user, uint256 _epoch) external view returns (uint256, uint256) {
return (
lqtyAllocationByUserAtEpoch[_user].items[_epoch].lqty,
lqtyAllocationByUserAtEpoch[_user].items[_epoch].offset
);
}
/// @inheritdoc IBribeInitiative
function depositBribe(uint256 _boldAmount, uint256 _bribeTokenAmount, uint256 _epoch) external {
uint256 epoch = governance.epoch();
require(_epoch >= epoch, "BribeInitiative: now-or-future-epochs");
bribeByEpoch[_epoch].remainingBoldAmount += _boldAmount;
bribeByEpoch[_epoch].remainingBribeTokenAmount += _bribeTokenAmount;
emit DepositBribe(msg.sender, _boldAmount, _bribeTokenAmount, _epoch);
bold.safeTransferFrom(msg.sender, address(this), _boldAmount);
bribeToken.safeTransferFrom(msg.sender, address(this), _bribeTokenAmount);
}
function _claimBribe(
address _user,
uint256 _epoch,
uint256 _prevLQTYAllocationEpoch,
uint256 _prevTotalLQTYAllocationEpoch
) internal returns (uint256 boldAmount, uint256 bribeTokenAmount) {
require(_epoch < governance.epoch(), "BribeInitiative: cannot-claim-for-current-epoch");
require(!claimedBribeAtEpoch[_user][_epoch], "BribeInitiative: already-claimed");
Bribe memory bribe = bribeByEpoch[_epoch];
require(bribe.remainingBoldAmount != 0 || bribe.remainingBribeTokenAmount != 0, "BribeInitiative: no-bribe");
DoubleLinkedList.Item memory lqtyAllocation =
lqtyAllocationByUserAtEpoch[_user].getItem(_prevLQTYAllocationEpoch);
require(
_prevLQTYAllocationEpoch <= _epoch && (lqtyAllocation.next > _epoch || lqtyAllocation.next == 0),
"BribeInitiative: invalid-prev-lqty-allocation-epoch"
);
DoubleLinkedList.Item memory totalLQTYAllocation =
totalLQTYAllocationByEpoch.getItem(_prevTotalLQTYAllocationEpoch);
require(
_prevTotalLQTYAllocationEpoch <= _epoch
&& (totalLQTYAllocation.next > _epoch || totalLQTYAllocation.next == 0),
"BribeInitiative: invalid-prev-total-lqty-allocation-epoch"
);
require(totalLQTYAllocation.lqty > 0, "BribeInitiative: total-lqty-allocation-zero");
require(lqtyAllocation.lqty > 0, "BribeInitiative: lqty-allocation-zero");
// `Governance` guarantees that `votes` evaluates to 0 or greater for each initiative at the time of allocation.
// Since the last possible moment to allocate within this epoch is 1 second before `epochEnd`, we have that:
// - `lqtyAllocation.lqty > 0` implies `votes > 0`
// - `totalLQTYAllocation.lqty > 0` implies `totalVotes > 0`
uint256 epochEnd = EPOCH_START + _epoch * EPOCH_DURATION;
uint256 totalVotes = _lqtyToVotes(totalLQTYAllocation.lqty, epochEnd, totalLQTYAllocation.offset);
uint256 votes = _lqtyToVotes(lqtyAllocation.lqty, epochEnd, lqtyAllocation.offset);
uint256 remainingVotes = totalVotes - bribe.claimedVotes;
boldAmount = bribe.remainingBoldAmount * votes / remainingVotes;
bribeTokenAmount = bribe.remainingBribeTokenAmount * votes / remainingVotes;
bribe.remainingBoldAmount -= boldAmount;
bribe.remainingBribeTokenAmount -= bribeTokenAmount;
bribe.claimedVotes += votes;
bribeByEpoch[_epoch] = bribe;
claimedBribeAtEpoch[_user][_epoch] = true;
emit ClaimBribe(_user, _epoch, boldAmount, bribeTokenAmount);
}
/// @inheritdoc IBribeInitiative
function claimBribes(ClaimData[] calldata _claimData)
external
returns (uint256 boldAmount, uint256 bribeTokenAmount)
{
for (uint256 i = 0; i < _claimData.length; i++) {
ClaimData memory claimData = _claimData[i];
(uint256 boldAmount_, uint256 bribeTokenAmount_) = _claimBribe(
msg.sender, claimData.epoch, claimData.prevLQTYAllocationEpoch, claimData.prevTotalLQTYAllocationEpoch
);
boldAmount += boldAmount_;
bribeTokenAmount += bribeTokenAmount_;
}
if (boldAmount != 0) bold.safeTransfer(msg.sender, boldAmount);
if (bribeTokenAmount != 0) bribeToken.safeTransfer(msg.sender, bribeTokenAmount);
}
/// @inheritdoc IInitiative
function onRegisterInitiative(uint256) external virtual override onlyGovernance {}
/// @inheritdoc IInitiative
function onUnregisterInitiative(uint256) external virtual override onlyGovernance {}
function _setTotalLQTYAllocationByEpoch(uint256 _epoch, uint256 _lqty, uint256 _offset, bool _insert) private {
if (_insert) {
totalLQTYAllocationByEpoch.insert(_epoch, _lqty, _offset, 0);
} else {
totalLQTYAllocationByEpoch.items[_epoch].lqty = _lqty;
totalLQTYAllocationByEpoch.items[_epoch].offset = _offset;
}
emit ModifyTotalLQTYAllocation(_epoch, _lqty, _offset);
}
function _setLQTYAllocationByUserAtEpoch(
address _user,
uint256 _epoch,
uint256 _lqty,
uint256 _offset,
bool _insert
) private {
if (_insert) {
lqtyAllocationByUserAtEpoch[_user].insert(_epoch, _lqty, _offset, 0);
} else {
lqtyAllocationByUserAtEpoch[_user].items[_epoch].lqty = _lqty;
lqtyAllocationByUserAtEpoch[_user].items[_epoch].offset = _offset;
}
emit ModifyLQTYAllocation(_user, _epoch, _lqty, _offset);
}
/// @inheritdoc IBribeInitiative
function getMostRecentUserEpoch(address _user) external view returns (uint256) {
uint256 mostRecentUserEpoch = lqtyAllocationByUserAtEpoch[_user].getHead();
return mostRecentUserEpoch;
}
/// @inheritdoc IBribeInitiative
function getMostRecentTotalEpoch() external view returns (uint256) {
uint256 mostRecentTotalEpoch = totalLQTYAllocationByEpoch.getHead();
return mostRecentTotalEpoch;
}
function onAfterAllocateLQTY(
uint256 _currentEpoch,
address _user,
IGovernance.UserState calldata,
IGovernance.Allocation calldata _allocation,
IGovernance.InitiativeState calldata _initiativeState
) external virtual onlyGovernance {
uint256 mostRecentUserEpoch = lqtyAllocationByUserAtEpoch[_user].getHead();
uint256 mostRecentTotalEpoch = totalLQTYAllocationByEpoch.getHead();
_setTotalLQTYAllocationByEpoch(
_currentEpoch,
_initiativeState.voteLQTY,
_initiativeState.voteOffset,
mostRecentTotalEpoch != _currentEpoch // Insert if current > recent
);
_setLQTYAllocationByUserAtEpoch(
_user,
_currentEpoch,
_allocation.voteLQTY,
_allocation.voteOffset,
mostRecentUserEpoch != _currentEpoch // Insert if user current > recent
);
}
/// @inheritdoc IInitiative
function onClaimForInitiative(uint256, uint256) external virtual override onlyGovernance {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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 v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IERC20} from "openzeppelin/contracts/interfaces/IERC20.sol";
import {ILQTYStaking} from "./ILQTYStaking.sol";
import {PermitParams} from "../utils/Types.sol";
uint256 constant UNREGISTERED_INITIATIVE = type(uint256).max;
interface IGovernance {
enum HookStatus {
Failed,
Succeeded,
NotCalled
}
/// @notice Emitted when a user deposits LQTY
/// @param user The account depositing LQTY
/// @param rewardRecipient The account receiving the LUSD/ETH rewards earned from staking in V1, if claimed
/// @param lqtyAmount The amount of LQTY being deposited
/// @return lusdReceived Amount of LUSD tokens received as a side-effect of staking new LQTY
/// @return lusdSent Amount of LUSD tokens sent to `rewardRecipient` (may include previously received LUSD)
/// @return ethReceived Amount of ETH received as a side-effect of staking new LQTY
/// @return ethSent Amount of ETH sent to `rewardRecipient` (may include previously received ETH)
event DepositLQTY(
address indexed user,
address rewardRecipient,
uint256 lqtyAmount,
uint256 lusdReceived,
uint256 lusdSent,
uint256 ethReceived,
uint256 ethSent
);
/// @notice Emitted when a user withdraws LQTY or claims V1 staking rewards
/// @param user The account withdrawing LQTY or claiming V1 staking rewards
/// @param recipient The account receiving the LQTY withdrawn, and if claimed, the LUSD/ETH rewards earned from staking in V1
/// @return lqtyReceived Amount of LQTY tokens actually withdrawn (may be lower than the `_lqtyAmount` passed to `withdrawLQTY`)
/// @return lqtySent Amount of LQTY tokens sent to `recipient` (may include LQTY sent to the user's proxy from sources other than V1 staking)
/// @return lusdReceived Amount of LUSD tokens received as a side-effect of staking new LQTY
/// @return lusdSent Amount of LUSD tokens sent to `recipient` (may include previously received LUSD)
/// @return ethReceived Amount of ETH received as a side-effect of staking new LQTY
/// @return ethSent Amount of ETH sent to `recipient` (may include previously received ETH)
event WithdrawLQTY(
address indexed user,
address recipient,
uint256 lqtyReceived,
uint256 lqtySent,
uint256 lusdReceived,
uint256 lusdSent,
uint256 ethReceived,
uint256 ethSent
);
event SnapshotVotes(uint256 votes, uint256 forEpoch, uint256 boldAccrued);
event SnapshotVotesForInitiative(address indexed initiative, uint256 votes, uint256 vetos, uint256 forEpoch);
event RegisterInitiative(address initiative, address registrant, uint256 atEpoch, HookStatus hookStatus);
event UnregisterInitiative(address initiative, uint256 atEpoch, HookStatus hookStatus);
event AllocateLQTY(
address indexed user,
address indexed initiative,
int256 deltaVoteLQTY,
int256 deltaVetoLQTY,
uint256 atEpoch,
HookStatus hookStatus
);
event ClaimForInitiative(address indexed initiative, uint256 bold, uint256 forEpoch, HookStatus hookStatus);
struct Configuration {
uint256 registrationFee;
uint256 registrationThresholdFactor;
uint256 unregistrationThresholdFactor;
uint256 unregistrationAfterEpochs;
uint256 votingThresholdFactor;
uint256 minClaim;
uint256 minAccrual;
uint256 epochStart;
uint256 epochDuration;
uint256 epochVotingCutoff;
}
function registerInitialInitiatives(address[] memory _initiatives) external;
/// @notice Address of the LQTY StakingV1 contract
/// @return stakingV1 Address of the LQTY StakingV1 contract
function stakingV1() external view returns (ILQTYStaking stakingV1);
/// @notice Address of the LQTY token
/// @return lqty Address of the LQTY token
function lqty() external view returns (IERC20 lqty);
/// @notice Address of the BOLD token
/// @return bold Address of the BOLD token
function bold() external view returns (IERC20 bold);
/// @notice Timestamp at which the first epoch starts
/// @return epochStart Timestamp at which the first epoch starts
function EPOCH_START() external view returns (uint256 epochStart);
/// @notice Duration of an epoch in seconds (e.g. 1 week)
/// @return epochDuration Epoch duration
function EPOCH_DURATION() external view returns (uint256 epochDuration);
/// @notice Voting period of an epoch in seconds (e.g. 6 days)
/// @return epochVotingCutoff Epoch voting cutoff
function EPOCH_VOTING_CUTOFF() external view returns (uint256 epochVotingCutoff);
/// @notice Minimum BOLD amount that has to be claimed, if an initiative doesn't have enough votes to meet the
/// criteria then it's votes a excluded from the vote count and distribution
/// @return minClaim Minimum claim amount
function MIN_CLAIM() external view returns (uint256 minClaim);
/// @notice Minimum amount of BOLD that have to be accrued for an epoch, otherwise accrual will be skipped for
/// that epoch
/// @return minAccrual Minimum amount of BOLD
function MIN_ACCRUAL() external view returns (uint256 minAccrual);
/// @notice Amount of BOLD to be paid in order to register a new initiative
/// @return registrationFee Registration fee
function REGISTRATION_FEE() external view returns (uint256 registrationFee);
/// @notice Share of all votes that are necessary to register a new initiative
/// @return registrationThresholdFactor Threshold factor
function REGISTRATION_THRESHOLD_FACTOR() external view returns (uint256 registrationThresholdFactor);
/// @notice Multiple of the voting threshold in vetos that are necessary to unregister an initiative
/// @return unregistrationThresholdFactor Unregistration threshold factor
function UNREGISTRATION_THRESHOLD_FACTOR() external view returns (uint256 unregistrationThresholdFactor);
/// @notice Number of epochs an initiative has to be inactive before it can be unregistered
/// @return unregistrationAfterEpochs Number of epochs
function UNREGISTRATION_AFTER_EPOCHS() external view returns (uint256 unregistrationAfterEpochs);
/// @notice Share of all votes that are necessary for an initiative to be included in the vote count
/// @return votingThresholdFactor Voting threshold factor
function VOTING_THRESHOLD_FACTOR() external view returns (uint256 votingThresholdFactor);
/// @notice Returns the amount of BOLD accrued since last epoch (last snapshot)
/// @return boldAccrued BOLD accrued
function boldAccrued() external view returns (uint256 boldAccrued);
struct VoteSnapshot {
uint256 votes; // Votes at epoch transition
uint256 forEpoch; // Epoch for which the votes are counted
}
struct InitiativeVoteSnapshot {
uint256 votes; // Votes at epoch transition
uint256 forEpoch; // Epoch for which the votes are counted
uint256 lastCountedEpoch; // Epoch at which which the votes where counted last in the global snapshot
uint256 vetos; // Vetos at epoch transition
}
/// @notice Returns the vote count snapshot of the previous epoch
/// @return votes Number of votes
/// @return forEpoch Epoch for which the votes are counted
function votesSnapshot() external view returns (uint256 votes, uint256 forEpoch);
/// @notice Returns the vote count snapshot for an initiative of the previous epoch
/// @param _initiative Address of the initiative
/// @return votes Number of votes
/// @return forEpoch Epoch for which the votes are counted
/// @return lastCountedEpoch Epoch at which which the votes where counted last in the global snapshot
function votesForInitiativeSnapshot(address _initiative)
external
view
returns (uint256 votes, uint256 forEpoch, uint256 lastCountedEpoch, uint256 vetos);
struct Allocation {
uint256 voteLQTY; // LQTY allocated vouching for the initiative
uint256 voteOffset; // Offset associated with LQTY vouching for the initiative
uint256 vetoLQTY; // LQTY vetoing the initiative
uint256 vetoOffset; // Offset associated with LQTY vetoing the initiative
uint256 atEpoch; // Epoch at which the allocation was last updated
}
struct UserState {
uint256 unallocatedLQTY; // LQTY deposited and unallocated
uint256 unallocatedOffset; // The offset sum corresponding to the unallocated LQTY
uint256 allocatedLQTY; // LQTY allocated by the user to initatives
uint256 allocatedOffset; // The offset sum corresponding to the allocated LQTY
}
struct InitiativeState {
uint256 voteLQTY; // LQTY allocated vouching for the initiative
uint256 voteOffset; // Offset associated with LQTY vouching for to the initative
uint256 vetoLQTY; // LQTY allocated vetoing the initiative
uint256 vetoOffset; // Offset associated with LQTY veoting the initative
uint256 lastEpochClaim;
}
struct GlobalState {
uint256 countedVoteLQTY; // Total LQTY that is included in vote counting
uint256 countedVoteOffset; // Offset associated with the counted vote LQTY
}
/// @notice Returns the user's state
/// @return unallocatedLQTY LQTY deposited and unallocated
/// @return unallocatedOffset Offset associated with unallocated LQTY
/// @return allocatedLQTY allocated by the user to initatives
/// @return allocatedOffset Offset associated with allocated LQTY
function userStates(address _user)
external
view
returns (uint256 unallocatedLQTY, uint256 unallocatedOffset, uint256 allocatedLQTY, uint256 allocatedOffset);
/// @notice Returns the initiative's state
/// @param _initiative Address of the initiative
/// @return voteLQTY LQTY allocated vouching for the initiative
/// @return voteOffset Offset associated with voteLQTY
/// @return vetoLQTY LQTY allocated vetoing the initiative
/// @return vetoOffset Offset associated with vetoLQTY
/// @return lastEpochClaim // Last epoch at which rewards were claimed
function initiativeStates(address _initiative)
external
view
returns (uint256 voteLQTY, uint256 voteOffset, uint256 vetoLQTY, uint256 vetoOffset, uint256 lastEpochClaim);
/// @notice Returns the global state
/// @return countedVoteLQTY Total LQTY that is included in vote counting
/// @return countedVoteOffset Offset associated with countedVoteLQTY
function globalState() external view returns (uint256 countedVoteLQTY, uint256 countedVoteOffset);
/// @notice Returns the amount of voting and vetoing LQTY a user allocated to an initiative
/// @param _user Address of the user
/// @param _initiative Address of the initiative
/// @return voteLQTY LQTY allocated vouching for the initiative
/// @return voteOffset The offset associated with voteLQTY
/// @return vetoLQTY allocated vetoing the initiative
/// @return vetoOffset the offset associated with vetoLQTY
/// @return atEpoch Epoch at which the allocation was last updated
function lqtyAllocatedByUserToInitiative(address _user, address _initiative)
external
view
returns (uint256 voteLQTY, uint256 voteOffset, uint256 vetoLQTY, uint256 vetoOffset, uint256 atEpoch);
/// @notice Returns when an initiative was registered
/// @param _initiative Address of the initiative
/// @return atEpoch If `_initiative` is an active initiative, returns the epoch at which it was registered.
/// If `_initiative` hasn't been registered, returns 0.
/// If `_initiative` has been unregistered, returns `UNREGISTERED_INITIATIVE`.
function registeredInitiatives(address _initiative) external view returns (uint256 atEpoch);
/*//////////////////////////////////////////////////////////////
STAKING
//////////////////////////////////////////////////////////////*/
/// @notice Deposits LQTY
/// @dev The caller has to approve their `UserProxy` address to spend the LQTY tokens
/// @param _lqtyAmount Amount of LQTY to deposit
function depositLQTY(uint256 _lqtyAmount) external;
/// @notice Deposits LQTY
/// @dev The caller has to approve their `UserProxy` address to spend the LQTY tokens
/// @param _lqtyAmount Amount of LQTY to deposit
/// @param _doSendRewards If true, send rewards claimed from LQTY staking
/// @param _recipient Address to which the tokens should be sent
function depositLQTY(uint256 _lqtyAmount, bool _doSendRewards, address _recipient) external;
/// @notice Deposits LQTY via Permit
/// @param _lqtyAmount Amount of LQTY to deposit
/// @param _permitParams Permit parameters
function depositLQTYViaPermit(uint256 _lqtyAmount, PermitParams calldata _permitParams) external;
/// @notice Deposits LQTY via Permit
/// @param _lqtyAmount Amount of LQTY to deposit
/// @param _permitParams Permit parameters
/// @param _doSendRewards If true, send rewards claimed from LQTY staking
/// @param _recipient Address to which the tokens should be sent
function depositLQTYViaPermit(
uint256 _lqtyAmount,
PermitParams calldata _permitParams,
bool _doSendRewards,
address _recipient
) external;
/// @notice Withdraws LQTY and claims any accrued LUSD and ETH rewards from StakingV1
/// @param _lqtyAmount Amount of LQTY to withdraw
function withdrawLQTY(uint256 _lqtyAmount) external;
/// @notice Withdraws LQTY and claims any accrued LUSD and ETH rewards from StakingV1
/// @param _lqtyAmount Amount of LQTY to withdraw
/// @param _doSendRewards If true, send rewards claimed from LQTY staking
/// @param _recipient Address to which the tokens should be sent
function withdrawLQTY(uint256 _lqtyAmount, bool _doSendRewards, address _recipient) external;
/// @notice Claims staking rewards from StakingV1 without unstaking
/// @dev Note: in the unlikely event that the caller's `UserProxy` holds any LQTY tokens, they will also be sent to `_rewardRecipient`
/// @param _rewardRecipient Address that will receive the rewards
/// @return lusdSent Amount of LUSD tokens sent to `_rewardRecipient` (may include previously received LUSD)
/// @return ethSent Amount of ETH sent to `_rewardRecipient` (may include previously received ETH)
function claimFromStakingV1(address _rewardRecipient) external returns (uint256 lusdSent, uint256 ethSent);
/*//////////////////////////////////////////////////////////////
VOTING
//////////////////////////////////////////////////////////////*/
/// @notice Returns the current epoch number
/// @return epoch Current epoch
function epoch() external view returns (uint256 epoch);
/// @notice Returns the timestamp at which the current epoch started
/// @return epochStart Epoch start of the current epoch
function epochStart() external view returns (uint256 epochStart);
/// @notice Returns the number of seconds that have gone by since the current epoch started
/// @return secondsWithinEpoch Seconds within the current epoch
function secondsWithinEpoch() external view returns (uint256 secondsWithinEpoch);
/// @notice Returns the voting power for an entity (i.e. user or initiative) at a given timestamp
/// @param _lqtyAmount Amount of LQTY associated with the entity
/// @param _timestamp Timestamp at which to calculate voting power
/// @param _offset The entity's offset sum
/// @return votes Number of votes
function lqtyToVotes(uint256 _lqtyAmount, uint256 _timestamp, uint256 _offset) external pure returns (uint256);
/// @dev Returns the most up to date voting threshold
/// In contrast to `getLatestVotingThreshold` this function updates the snapshot
/// This ensures that the value returned is always the latest
function calculateVotingThreshold() external returns (uint256);
/// @dev Utility function to compute the threshold votes without recomputing the snapshot
/// Note that `boldAccrued` is a cached value, this function works correctly only when called after an accrual
function calculateVotingThreshold(uint256 _votes) external view returns (uint256);
/// @notice Return the most up to date global snapshot and state as well as a flag to notify whether the state can be updated
/// This is a convenience function to always retrieve the most up to date state values
function getTotalVotesAndState()
external
view
returns (VoteSnapshot memory snapshot, GlobalState memory state, bool shouldUpdate);
/// @dev Given an initiative address, return it's most up to date snapshot and state as well as a flag to notify whether the state can be updated
/// This is a convenience function to always retrieve the most up to date state values
function getInitiativeSnapshotAndState(address _initiative)
external
view
returns (
InitiativeVoteSnapshot memory initiativeSnapshot,
InitiativeState memory initiativeState,
bool shouldUpdate
);
/// @notice Voting threshold is the max. of either:
/// - 4% of the total voting LQTY in the previous epoch
/// - or the minimum number of votes necessary to claim at least MIN_CLAIM BOLD
/// This value can be offsynch, use the non view `calculateVotingThreshold` to always retrieve the most up to date value
/// @return votingThreshold Voting threshold
function getLatestVotingThreshold() external view returns (uint256 votingThreshold);
/// @notice Snapshots votes for the previous epoch and accrues funds for the current epoch
/// @param _initiative Address of the initiative
/// @return voteSnapshot Vote snapshot
/// @return initiativeVoteSnapshot Vote snapshot of the initiative
function snapshotVotesForInitiative(address _initiative)
external
returns (VoteSnapshot memory voteSnapshot, InitiativeVoteSnapshot memory initiativeVoteSnapshot);
/*//////////////////////////////////////////////////////////////
FSM
//////////////////////////////////////////////////////////////*/
enum InitiativeStatus {
NONEXISTENT,
/// This Initiative Doesn't exist | This is never returned
WARM_UP,
/// This epoch was just registered
SKIP,
/// This epoch will result in no rewards and no unregistering
CLAIMABLE,
/// This epoch will result in claiming rewards
CLAIMED,
/// The rewards for this epoch have been claimed
UNREGISTERABLE,
/// Can be unregistered
DISABLED // It was already Unregistered
}
function getInitiativeState(address _initiative)
external
returns (InitiativeStatus status, uint256 lastEpochClaim, uint256 claimableAmount);
function getInitiativeState(
address _initiative,
VoteSnapshot memory _votesSnapshot,
InitiativeVoteSnapshot memory _votesForInitiativeSnapshot,
InitiativeState memory _initiativeState
) external view returns (InitiativeStatus status, uint256 lastEpochClaim, uint256 claimableAmount);
/// @notice Registers a new initiative
/// @param _initiative Address of the initiative
function registerInitiative(address _initiative) external;
// /// @notice Unregisters an initiative if it didn't receive enough votes in the last 4 epochs
// /// or if it received more vetos than votes and the number of vetos are greater than 3 times the voting threshold
// /// @param _initiative Address of the initiative
function unregisterInitiative(address _initiative) external;
/// @notice Allocates the user's LQTY to initiatives
/// @dev The user can only allocate to active initiatives (older than 1 epoch) and has to have enough unallocated
/// LQTY available, the initiatives listed must be unique, and towards the end of the epoch a user can only maintain or reduce their votes
/// @param _initiativesToReset Addresses of the initiatives the caller was previously allocated to, must be reset to prevent desynch of voting power
/// @param _initiatives Addresses of the initiatives to allocate to, can match or be different from `_resetInitiatives`
/// @param _absoluteLQTYVotes LQTY to allocate to the initiatives as votes
/// @param _absoluteLQTYVetos LQTY to allocate to the initiatives as vetos
function allocateLQTY(
address[] calldata _initiativesToReset,
address[] memory _initiatives,
int256[] memory _absoluteLQTYVotes,
int256[] memory _absoluteLQTYVetos
) external;
/// @notice Deallocates the user's LQTY from initiatives
/// @param _initiativesToReset Addresses of initiatives to deallocate LQTY from
/// @param _checkAll When true, the call will revert if there is still some allocated LQTY left after deallocating
/// from all the addresses in `_initiativesToReset`
function resetAllocations(address[] calldata _initiativesToReset, bool _checkAll) external;
/// @notice Splits accrued funds according to votes received between all initiatives
/// @param _initiative Addresse of the initiative
/// @return claimed Amount of BOLD claimed
function claimForInitiative(address _initiative) external returns (uint256 claimed);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IGovernance} from "./IGovernance.sol";
interface IInitiative {
/// @notice Callback hook that is called by Governance after the initiative was successfully registered
/// @param _atEpoch Epoch at which the initiative is registered
function onRegisterInitiative(uint256 _atEpoch) external;
/// @notice Callback hook that is called by Governance after the initiative was unregistered
/// @param _atEpoch Epoch at which the initiative is unregistered
function onUnregisterInitiative(uint256 _atEpoch) external;
/// @notice Callback hook that is called by Governance after the LQTY allocation is updated by a user
/// @param _currentEpoch Epoch at which the LQTY allocation is updated
/// @param _user Address of the user that updated their LQTY allocation
/// @param _userState User state
/// @param _allocation Allocation state from user to initiative
/// @param _initiativeState Initiative state
function onAfterAllocateLQTY(
uint256 _currentEpoch,
address _user,
IGovernance.UserState calldata _userState,
IGovernance.Allocation calldata _allocation,
IGovernance.InitiativeState calldata _initiativeState
) external;
/// @notice Callback hook that is called by Governance after the claim for the last epoch was distributed
/// to the initiative
/// @param _claimEpoch Epoch at which the claim was distributed
/// @param _bold Amount of BOLD that was distributed
function onClaimForInitiative(uint256 _claimEpoch, uint256 _bold) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IERC20} from "openzeppelin/contracts/interfaces/IERC20.sol";
import {IGovernance} from "./IGovernance.sol";
interface IBribeInitiative {
event DepositBribe(address depositor, uint256 boldAmount, uint256 bribeTokenAmount, uint256 epoch);
event ModifyLQTYAllocation(address user, uint256 epoch, uint256 lqtyAllocated, uint256 offset);
event ModifyTotalLQTYAllocation(uint256 epoch, uint256 totalLQTYAllocated, uint256 offset);
event ClaimBribe(address user, uint256 epoch, uint256 boldAmount, uint256 bribeTokenAmount);
/// @notice Address of the governance contract
/// @return governance Adress of the governance contract
function governance() external view returns (IGovernance governance);
/// @notice Address of the BOLD token
/// @return bold Address of the BOLD token
function bold() external view returns (IERC20 bold);
/// @notice Address of the bribe token
/// @return bribeToken Address of the bribe token
function bribeToken() external view returns (IERC20 bribeToken);
struct Bribe {
uint256 remainingBoldAmount;
uint256 remainingBribeTokenAmount; // [scaled as 10 ** bribeToken.decimals()]
uint256 claimedVotes;
}
/// @notice Amount of bribe tokens deposited for a given epoch
/// @param _epoch Epoch at which the bribe was deposited
/// @return remainingBoldAmount Amount of BOLD tokens that haven't been claimed yet
/// @return remainingBribeTokenAmount Amount of bribe tokens that haven't been claimed yet
/// @return claimedVotes Sum of voting power of users who have already claimed their bribes
function bribeByEpoch(uint256 _epoch)
external
view
returns (uint256 remainingBoldAmount, uint256 remainingBribeTokenAmount, uint256 claimedVotes);
/// @notice Check if a user has claimed bribes for a given epoch
/// @param _user Address of the user
/// @param _epoch Epoch at which the bribe may have been claimed by the user
/// @return claimed If the user has claimed the bribe
function claimedBribeAtEpoch(address _user, uint256 _epoch) external view returns (bool claimed);
/// @notice Total LQTY allocated to the initiative at a given epoch
/// Voting power can be calculated as `totalLQTYAllocated * timestamp - offset`
/// @param _epoch Epoch at which the LQTY was allocated
/// @return totalLQTYAllocated Total LQTY allocated
/// @return offset Voting power offset
function totalLQTYAllocatedByEpoch(uint256 _epoch)
external
view
returns (uint256 totalLQTYAllocated, uint256 offset);
/// @notice LQTY allocated by a user to the initiative at a given epoch
/// Voting power can be calculated as `lqtyAllocated * timestamp - offset`
/// @param _user Address of the user
/// @param _epoch Epoch at which the LQTY was allocated by the user
/// @return lqtyAllocated LQTY allocated by the user
/// @return offset Voting power offset
function lqtyAllocatedByUserAtEpoch(address _user, uint256 _epoch)
external
view
returns (uint256 lqtyAllocated, uint256 offset);
/// @notice Deposit bribe tokens for a given epoch
/// @dev The caller has to approve this contract to spend the BOLD and bribe tokens.
/// The caller can only deposit bribes for future epochs
/// @param _boldAmount Amount of BOLD tokens to deposit
/// @param _bribeTokenAmount Amount of bribe tokens to deposit
/// @param _epoch Epoch at which the bribe is deposited
function depositBribe(uint256 _boldAmount, uint256 _bribeTokenAmount, uint256 _epoch) external;
struct ClaimData {
// Epoch at which the user wants to claim the bribes
uint256 epoch;
// Epoch at which the user updated the LQTY allocation for this initiative
uint256 prevLQTYAllocationEpoch;
// Epoch at which the total LQTY allocation is updated for this initiative
uint256 prevTotalLQTYAllocationEpoch;
}
/// @notice Claim bribes for a user
/// @dev The user can only claim bribes for past epochs.
/// The arrays `_epochs`, `_prevLQTYAllocationEpochs` and `_prevTotalLQTYAllocationEpochs` should be sorted
/// from oldest epoch to the newest. The length of the arrays has to be the same.
/// @param _claimData Array specifying the epochs at which the user wants to claim the bribes
function claimBribes(ClaimData[] calldata _claimData)
external
returns (uint256 boldAmount, uint256 bribeTokenAmount);
/// @notice Given a user address return the last recorded epoch for their allocation
function getMostRecentUserEpoch(address _user) external view returns (uint256);
/// @notice Return the last recorded epoch for the system
function getMostRecentTotalEpoch() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title DoubleLinkedList
/// @notice Implements a double linked list where the head is defined as the null item's prev pointer
/// and the tail is defined as the null item's next pointer ([tail][prev][item][next][head])
library DoubleLinkedList {
struct Item {
uint256 lqty;
uint256 offset;
uint256 prev;
uint256 next;
}
struct List {
mapping(uint256 => Item) items;
}
error IdIsZero();
error ItemNotInList();
error ItemInList();
/// @notice Returns the head item id of the list
/// @param list Linked list which contains the item
/// @return _ Id of the head item
function getHead(List storage list) internal view returns (uint256) {
return list.items[0].prev;
}
/// @notice Returns the tail item id of the list
/// @param list Linked list which contains the item
/// @return _ Id of the tail item
function getTail(List storage list) internal view returns (uint256) {
return list.items[0].next;
}
/// @notice Returns the item id which follows item `id`. Returns the tail item id of the list if the `id` is 0.
/// @param list Linked list which contains the items
/// @param id Id of the current item
/// @return _ Id of the current item's next item
function getNext(List storage list, uint256 id) internal view returns (uint256) {
return list.items[id].next;
}
/// @notice Returns the item id which precedes item `id`. Returns the head item id of the list if the `id` is 0.
/// @param list Linked list which contains the items
/// @param id Id of the current item
/// @return _ Id of the current item's previous item
function getPrev(List storage list, uint256 id) internal view returns (uint256) {
return list.items[id].prev;
}
/// @notice Returns the value of item `id`
/// @param list Linked list which contains the item
/// @param id Id of the item
/// @return LQTY associated with the item
/// @return Offset associated with the item's LQTY
function getLQTYAndOffset(List storage list, uint256 id) internal view returns (uint256, uint256) {
return (list.items[id].lqty, list.items[id].offset);
}
/// @notice Returns the item `id`
/// @param list Linked list which contains the item
/// @param id Id of the item
/// @return _ Item
function getItem(List storage list, uint256 id) internal view returns (Item memory) {
return list.items[id];
}
/// @notice Returns whether the list contains item `id`
/// @param list Linked list which should contain the item
/// @param id Id of the item to check
/// @return _ True if the list contains the item, false otherwise
function contains(List storage list, uint256 id) internal view returns (bool) {
if (id == 0) revert IdIsZero();
return (list.items[id].prev != 0 || list.items[id].next != 0 || list.items[0].next == id);
}
/// @notice Inserts an item with `id` in the list before item `next`
/// - if `next` is 0, the item is inserted at the start (head) of the list
/// @dev This function should not be called with an `id` that is already in the list.
/// @param list Linked list which contains the next item and into which the new item will be inserted
/// @param id Id of the item to insert
/// @param lqty amount of LQTY
/// @param offset associated with the LQTY amount
/// @param next Id of the item which should follow item `id`
function insert(List storage list, uint256 id, uint256 lqty, uint256 offset, uint256 next) internal {
if (contains(list, id)) revert ItemInList();
if (next != 0 && !contains(list, next)) revert ItemNotInList();
uint256 prev = list.items[next].prev;
list.items[prev].next = id;
list.items[next].prev = id;
list.items[id].prev = prev;
list.items[id].next = next;
list.items[id].lqty = lqty;
list.items[id].offset = offset;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
function _lqtyToVotes(uint256 _lqtyAmount, uint256 _timestamp, uint256 _offset) pure returns (uint256) {
uint256 prod = _lqtyAmount * _timestamp;
return prod > _offset ? prod - _offset : 0;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface ILQTYStaking {
// --- Events --
event LQTYTokenAddressSet(address _lqtyTokenAddress);
event LUSDTokenAddressSet(address _lusdTokenAddress);
event TroveManagerAddressSet(address _troveManager);
event BorrowerOperationsAddressSet(address _borrowerOperationsAddress);
event ActivePoolAddressSet(address _activePoolAddress);
event StakeChanged(address indexed staker, uint256 newStake);
event StakingGainsWithdrawn(address indexed staker, uint256 LUSDGain, uint256 ETHGain);
event F_ETHUpdated(uint256 _F_ETH);
event F_LUSDUpdated(uint256 _F_LUSD);
event TotalLQTYStakedUpdated(uint256 _totalLQTYStaked);
event EtherSent(address _account, uint256 _amount);
event StakerSnapshotsUpdated(address _staker, uint256 _F_ETH, uint256 _F_LUSD);
// --- Functions ---
function setAddresses(
address _lqtyTokenAddress,
address _lusdTokenAddress,
address _troveManagerAddress,
address _borrowerOperationsAddress,
address _activePoolAddress
) external;
function stake(uint256 _LQTYamount) external;
function unstake(uint256 _LQTYamount) external;
function increaseF_ETH(uint256 _ETHFee) external;
function increaseF_LUSD(uint256 _LQTYFee) external;
function getPendingETHGain(address _user) external view returns (uint256);
function getPendingLUSDGain(address _user) external view returns (uint256);
function stakes(address _user) external view returns (uint256);
function totalLQTYStaked() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
struct PermitParams {
address owner;
address spender;
uint256 value;
uint256 deadline;
uint8 v;
bytes32 r;
bytes32 s;
}
uint256 constant WAD = 1e18;{
"remappings": [
"v4-core/=lib/v4-core/",
"forge-std/=lib/forge-std/src/",
"@chimera/=lib/chimera/src/",
"openzeppelin/=lib/openzeppelin-contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"chimera/=lib/chimera/src/",
"ds-test/=lib/chimera/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 100000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_governance","type":"address"},{"internalType":"address","name":"_bold","type":"address"},{"internalType":"address","name":"_bribeToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"IdIsZero","type":"error"},{"inputs":[],"name":"ItemInList","type":"error"},{"inputs":[],"name":"ItemNotInList","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BoldRewardsReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"boldAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bribeTokenAmount","type":"uint256"}],"name":"ClaimBribe","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"boldAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bribeTokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"DepositBribe","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lqtyAllocated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offset","type":"uint256"}],"name":"ModifyLQTYAllocation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalLQTYAllocated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offset","type":"uint256"}],"name":"ModifyTotalLQTYAllocation","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"},{"inputs":[],"name":"bold","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bribeByEpoch","outputs":[{"internalType":"uint256","name":"remainingBoldAmount","type":"uint256"},{"internalType":"uint256","name":"remainingBribeTokenAmount","type":"uint256"},{"internalType":"uint256","name":"claimedVotes","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bribeToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"prevLQTYAllocationEpoch","type":"uint256"},{"internalType":"uint256","name":"prevTotalLQTYAllocationEpoch","type":"uint256"}],"internalType":"struct IBribeInitiative.ClaimData[]","name":"_claimData","type":"tuple[]"}],"name":"claimBribes","outputs":[{"internalType":"uint256","name":"boldAmount","type":"uint256"},{"internalType":"uint256","name":"bribeTokenAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimedBribeAtEpoch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_boldAmount","type":"uint256"},{"internalType":"uint256","name":"_bribeTokenAmount","type":"uint256"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"depositBribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"exec","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getMostRecentTotalEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getMostRecentUserEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"contract IGovernance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"lqtyAllocatedByUserAtEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_currentEpoch","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"components":[{"internalType":"uint256","name":"unallocatedLQTY","type":"uint256"},{"internalType":"uint256","name":"unallocatedOffset","type":"uint256"},{"internalType":"uint256","name":"allocatedLQTY","type":"uint256"},{"internalType":"uint256","name":"allocatedOffset","type":"uint256"}],"internalType":"struct IGovernance.UserState","name":"","type":"tuple"},{"components":[{"internalType":"uint256","name":"voteLQTY","type":"uint256"},{"internalType":"uint256","name":"voteOffset","type":"uint256"},{"internalType":"uint256","name":"vetoLQTY","type":"uint256"},{"internalType":"uint256","name":"vetoOffset","type":"uint256"},{"internalType":"uint256","name":"atEpoch","type":"uint256"}],"internalType":"struct IGovernance.Allocation","name":"_allocation","type":"tuple"},{"components":[{"internalType":"uint256","name":"voteLQTY","type":"uint256"},{"internalType":"uint256","name":"voteOffset","type":"uint256"},{"internalType":"uint256","name":"vetoLQTY","type":"uint256"},{"internalType":"uint256","name":"vetoOffset","type":"uint256"},{"internalType":"uint256","name":"lastEpochClaim","type":"uint256"}],"internalType":"struct IGovernance.InitiativeState","name":"_initiativeState","type":"tuple"}],"name":"onAfterAllocateLQTY","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"boldAmount","type":"uint256"}],"name":"onClaimForInitiative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"onRegisterInitiative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"onUnregisterInitiative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"totalLQTYAllocatedByEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
61012060405234801562000011575f80fd5b50604051620022f8380380620022f883398101604081905262000034916200024f565b33838383816001600160a01b0316816001600160a01b031603620000b35760405162461bcd60e51b815260206004820152602b60248201527f4272696265496e69746961746976653a2062726962652d746f6b656e2d63616e60448201526a1b9bdd0b58994b589bdb1960aa1b60648201526084015b60405180910390fd5b6001600160a01b0380841660c081905283821660e05290821661010052604080516346d62a6360e01b815290516346d62a63916004808201926020929091908290030181865afa1580156200010a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000130919062000296565b6080818152505060c0516001600160a01b031663a70b9f0c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000176573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200019c919062000296565b60a0525050506001600160a01b038116620001cd57604051631e4fbdf760e01b81525f6004820152602401620000aa565b620001d881620001e2565b50505050620002ae565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b80516001600160a01b03811681146200024a575f80fd5b919050565b5f805f6060848603121562000262575f80fd5b6200026d8462000233565b92506200027d6020850162000233565b91506200028d6040850162000233565b90509250925092565b5f60208284031215620002a7575f80fd5b5051919050565b60805160a05160c05160e05161010051611fc6620003325f395f81816101ff015281816109ee0152610b1301525f818161030601528181610616015281816109ac0152610acc01525f81816102570152818161058d01528181610759015281816107e601528181610b590152610e9601525f6113aa01525f6113d50152611fc65ff3fe60806040526004361061013d575f3560e01c8063727d0f35116100bb578063c1932ea411610071578063e89946e211610057578063e89946e214610405578063f0f2698d1461045b578063f2fde38b1461046f575f80fd5b8063c1932ea4146103b9578063e6fc3786146103d8575f80fd5b806381c4fea5116100a157806381c4fea5146103705780638da5cb5b1461038f578063955161cd14610175575f80fd5b8063727d0f35146102f55780637c1f362714610328575f80fd5b806358c93f78116101105780635bab17b1116100f65780635bab17b11461027957806363efdf4a14610298578063715018a6146102e1575f80fd5b806358c93f78146101ee5780635aa6e67514610246575f80fd5b80630565bb67146101415780631e18de1a146101565780632695d74d146101755780633c81554914610194575b5f80fd5b61015461014f366004611ba4565b61048e565b005b348015610161575f80fd5b50610154610170366004611c24565b610575565b348015610180575f80fd5b5061015461018f366004611c44565b610741565b34801561019f575f80fd5b506101ce6101ae366004611c44565b5f6020819052908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b3480156101f9575f80fd5b506102217f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101e5565b348015610251575f80fd5b506102217f000000000000000000000000000000000000000000000000000000000000000081565b348015610284575f80fd5b50610154610293366004611c5b565b6107e3565b3480156102a3575f80fd5b506102d16102b2366004611c84565b600160209081525f928352604080842090915290825290205460ff1681565b60405190151581526020016101e5565b3480156102ec575f80fd5b50610154610a1c565b348015610300575f80fd5b506102217f000000000000000000000000000000000000000000000000000000000000000081565b348015610333575f80fd5b5061035b610342366004611c44565b5f90815260026020526040902080546001909101549091565b604080519283526020830191909152016101e5565b34801561037b575f80fd5b5061035b61038a366004611cac565b610a2f565b34801561039a575f80fd5b5060045473ffffffffffffffffffffffffffffffffffffffff16610221565b3480156103c4575f80fd5b506101546103d3366004611d31565b610b41565b3480156103e3575f80fd5b506103f76103f2366004611db8565b610c6f565b6040519081526020016101e5565b348015610410575f80fd5b5061035b61041f366004611c84565b73ffffffffffffffffffffffffffffffffffffffff919091165f9081526003602090815260408083209383529290522080546001909101549091565b348015610466575f80fd5b506103f7610cac565b34801561047a575f80fd5b50610154610489366004611db8565b610ce0565b610496610d40565b5f8473ffffffffffffffffffffffffffffffffffffffff168484846040516104bf929190611dd1565b5f6040518083038185875af1925050503d805f81146104f9576040519150601f19603f3d011682016040523d82523d5f602084013e6104fe565b606091505b505090508061056e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f43616c6c206661696c656400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4272696265496e69746961746976653a20696e76616c69642d73656e646572006044820152606401610565565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61066f60045473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018490526044016020604051808303815f875af11580156106de573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107029190611de0565b50817f558c9e62ff2d14635d948d5dc2ebad6b5d4ddb24ba7e6f3039ca5b6ae22e17428260405161073591815260200190565b60405180910390a25050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146107e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4272696265496e69746961746976653a20696e76616c69642d73656e646572006044820152606401610565565b50565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663900cf0cf6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561084d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108719190611dff565b905080821015610903576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4272696265496e69746961746976653a206e6f772d6f722d6675747572652d6560448201527f706f6368730000000000000000000000000000000000000000000000000000006064820152608401610565565b5f8281526020819052604081208054869290610920908490611e43565b90915550505f8281526020819052604081206001018054859290610945908490611e43565b90915550506040805133815260208101869052908101849052606081018390527f8da751404c1c12bd225230d318ca0913aab7a5f98c004ae97cf1b7072e7f119d9060800160405180910390a16109d473ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333087610d93565b610a1673ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333086610d93565b50505050565b610a24610d40565b610a2d5f610e1c565b565b5f805f5b83811015610aab575f858583818110610a4e57610a4e611e56565b905060600201803603810190610a649190611e83565b90505f80610a7f33845f015185602001518660400151610e92565b9092509050610a8e8287611e43565b9550610a9a8186611e43565b94505060019092019150610a339050565b508115610af357610af373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633846115c5565b8015610b3a57610b3a73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633836115c5565b9250929050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4272696265496e69746961746976653a20696e76616c69642d73656e646572006044820152606401610565565b73ffffffffffffffffffffffffffffffffffffffff84165f90815260036020908152604080832083805282529091206002908101549082527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077d549091610c5190889085359086013582851415611608565b610c668688863560208801358683141561167f565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260036020908152604080832083805290915281206002015481905b9392505050565b5f80805260026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077d5481905b92915050565b610ce8610d40565b73ffffffffffffffffffffffffffffffffffffffff8116610d37576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f6004820152602401610565565b6107e081610e1c565b60045473ffffffffffffffffffffffffffffffffffffffff163314610a2d576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610565565b60405173ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260648201839052610a169186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061175b565b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663900cf0cf6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610efd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f219190611dff565b8510610faf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4272696265496e69746961746976653a2063616e6e6f742d636c61696d2d666f60448201527f722d63757272656e742d65706f636800000000000000000000000000000000006064820152608401610565565b73ffffffffffffffffffffffffffffffffffffffff86165f90815260016020908152604080832088845290915290205460ff1615611049576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4272696265496e69746961746976653a20616c72656164792d636c61696d65646044820152606401610565565b5f8581526020818152604091829020825160608101845281548082526001830154938201939093526002909101549281019290925215158061108e5750602081015115155b6110f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4272696265496e69746961746976653a206e6f2d6272696265000000000000006044820152606401610565565b73ffffffffffffffffffffffffffffffffffffffff87165f90815260036020526040812061112290876117ef565b90508686111580156111435750868160600151118061114357506060810151155b6111cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f4272696265496e69746961746976653a20696e76616c69642d707265762d6c7160448201527f74792d616c6c6f636174696f6e2d65706f6368000000000000000000000000006064820152608401610565565b5f6111db6002876117ef565b90508786111580156111fc575087816060015111806111fc57506060810151155b611288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f4272696265496e69746961746976653a20696e76616c69642d707265762d746f60448201527f74616c2d6c7174792d616c6c6f636174696f6e2d65706f6368000000000000006064820152608401610565565b8051611316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4272696265496e69746961746976653a20746f74616c2d6c7174792d616c6c6f60448201527f636174696f6e2d7a65726f0000000000000000000000000000000000000000006064820152608401610565565b81516113a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4272696265496e69746961746976653a206c7174792d616c6c6f636174696f6e60448201527f2d7a65726f0000000000000000000000000000000000000000000000000000006064820152608401610565565b5f6113cf7f00000000000000000000000000000000000000000000000000000000000000008a611f02565b6113f9907f0000000000000000000000000000000000000000000000000000000000000000611e43565b90505f61140e835f0151838560200151611856565b90505f611423855f0151848760200151611856565b90505f8660400151836114369190611f19565b90508082885f01516114489190611f02565b6114529190611f2c565b9850808288602001516114659190611f02565b61146f9190611f2c565b975088875f018181516114829190611f19565b905250602087018051899190611499908390611f19565b9052506040870180518391906114b0908390611e43565b91508181525050865f808e81526020019081526020015f205f820151815f015560208201518160010155604082015181600201559050506001805f8f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8e81526020019081526020015f205f6101000a81548160ff0219169083151502179055507f520304589c9512f04f4c28f0a5f365d2620fea83386850175628ebfe3d52b6838d8d8b8b6040516115ad949392919073ffffffffffffffffffffffffffffffffffffffff94909416845260208401929092526040830152606082015260800190565b60405180910390a15050505050505094509492505050565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261160391859182169063a9059cbb90606401610dd5565b505050565b80156116215761161c60028585855f611884565b611638565b5f8481526002602052604090208381556001018290555b60408051858152602081018590529081018390527ff3585f583ce8a74a5f014115d0a23ad6246464e971fe5701465b9976dc9c5bcd9060600160405180910390a150505050565b80156116bd5773ffffffffffffffffffffffffffffffffffffffff85165f9081526003602052604081206116b891869086908690611884565b6116f6565b73ffffffffffffffffffffffffffffffffffffffff85165f90815260036020908152604080832087845290915290208381556001018290555b6040805173ffffffffffffffffffffffffffffffffffffffff8716815260208101869052908101849052606081018390527f3cf1dea48fd0f5e4db76fa66b9f662a7a8e3c185f34763189efc609691e327529060800160405180910390a15050505050565b5f61177c73ffffffffffffffffffffffffffffffffffffffff84168361195a565b905080515f141580156117a057508080602001905181019061179e9190611de0565b155b15611603576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610565565b61181660405180608001604052805f81526020015f81526020015f81526020015f81525090565b505f908152602091825260409081902081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015290565b5f806118628486611f02565b9050828111611871575f61187b565b61187b8382611f19565b95945050505050565b61188e8585611967565b156118c5576040517f3c57789e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80158015906118db57506118d98582611967565b155b15611912576040517fac9c4cae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f818152602095909552604080862060029081018054808952838920600390810189905591889055968852919096209586019490945592840192909255825560019190910155565b6060610ca583835f6119ec565b5f815f036119a1576040517fee7efd5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152602084905260409020600201541515806119ce57505f8281526020849052604090206003015415155b80610ca55750505f8080526020929092526040909120600301541490565b606081471015611a2a576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610565565b5f808573ffffffffffffffffffffffffffffffffffffffff168486604051611a529190611f64565b5f6040518083038185875af1925050503d805f8114611a8c576040519150601f19603f3d011682016040523d82523d5f602084013e611a91565b606091505b5091509150611aa1868383611aab565b9695505050505050565b606082611ac057611abb82611b3a565b610ca5565b8151158015611ae4575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611b33576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610565565b5080610ca5565b805115611b4a5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b803573ffffffffffffffffffffffffffffffffffffffff81168114611b9f575f80fd5b919050565b5f805f8060608587031215611bb7575f80fd5b611bc085611b7c565b935060208501359250604085013567ffffffffffffffff80821115611be3575f80fd5b818701915087601f830112611bf6575f80fd5b813581811115611c04575f80fd5b886020828501011115611c15575f80fd5b95989497505060200194505050565b5f8060408385031215611c35575f80fd5b50508035926020909101359150565b5f60208284031215611c54575f80fd5b5035919050565b5f805f60608486031215611c6d575f80fd5b505081359360208301359350604090920135919050565b5f8060408385031215611c95575f80fd5b611c9e83611b7c565b946020939093013593505050565b5f8060208385031215611cbd575f80fd5b823567ffffffffffffffff80821115611cd4575f80fd5b818501915085601f830112611ce7575f80fd5b813581811115611cf5575f80fd5b866020606083028501011115611d09575f80fd5b60209290920196919550909350505050565b5f60a08284031215611d2b575f80fd5b50919050565b5f805f805f858703610200811215611d47575f80fd5b86359550611d5760208801611b7c565b945060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215611d88575f80fd5b50604086019250611d9c8760c08801611d1b565b9150611dac876101608801611d1b565b90509295509295909350565b5f60208284031215611dc8575f80fd5b610ca582611b7c565b818382375f9101908152919050565b5f60208284031215611df0575f80fd5b81518015158114610ca5575f80fd5b5f60208284031215611e0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610cda57610cda611e16565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60608284031215611e93575f80fd5b6040516060810181811067ffffffffffffffff82111715611edb577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b80604052508235815260208301356020820152604083013560408201528091505092915050565b8082028115828204841417610cda57610cda611e16565b81810381811115610cda57610cda611e16565b5f82611f5f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f82515f5b81811015611f835760208186018101518583015201611f69565b505f92019182525091905056fea2646970667358221220066b21d881425daccdd07bad527b07260a2e6ddd486cc1917ff877cc271bf1d964736f6c63430008180033000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee10000000000000000000000006440f144b7e50d6a8439336510312d2f54beb01d00000000000000000000000004c46e830bb56ce22735d5d8fc9cb90309317d0f
Deployed Bytecode
0x60806040526004361061013d575f3560e01c8063727d0f35116100bb578063c1932ea411610071578063e89946e211610057578063e89946e214610405578063f0f2698d1461045b578063f2fde38b1461046f575f80fd5b8063c1932ea4146103b9578063e6fc3786146103d8575f80fd5b806381c4fea5116100a157806381c4fea5146103705780638da5cb5b1461038f578063955161cd14610175575f80fd5b8063727d0f35146102f55780637c1f362714610328575f80fd5b806358c93f78116101105780635bab17b1116100f65780635bab17b11461027957806363efdf4a14610298578063715018a6146102e1575f80fd5b806358c93f78146101ee5780635aa6e67514610246575f80fd5b80630565bb67146101415780631e18de1a146101565780632695d74d146101755780633c81554914610194575b5f80fd5b61015461014f366004611ba4565b61048e565b005b348015610161575f80fd5b50610154610170366004611c24565b610575565b348015610180575f80fd5b5061015461018f366004611c44565b610741565b34801561019f575f80fd5b506101ce6101ae366004611c44565b5f6020819052908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b3480156101f9575f80fd5b506102217f00000000000000000000000004c46e830bb56ce22735d5d8fc9cb90309317d0f81565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101e5565b348015610251575f80fd5b506102217f000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee181565b348015610284575f80fd5b50610154610293366004611c5b565b6107e3565b3480156102a3575f80fd5b506102d16102b2366004611c84565b600160209081525f928352604080842090915290825290205460ff1681565b60405190151581526020016101e5565b3480156102ec575f80fd5b50610154610a1c565b348015610300575f80fd5b506102217f0000000000000000000000006440f144b7e50d6a8439336510312d2f54beb01d81565b348015610333575f80fd5b5061035b610342366004611c44565b5f90815260026020526040902080546001909101549091565b604080519283526020830191909152016101e5565b34801561037b575f80fd5b5061035b61038a366004611cac565b610a2f565b34801561039a575f80fd5b5060045473ffffffffffffffffffffffffffffffffffffffff16610221565b3480156103c4575f80fd5b506101546103d3366004611d31565b610b41565b3480156103e3575f80fd5b506103f76103f2366004611db8565b610c6f565b6040519081526020016101e5565b348015610410575f80fd5b5061035b61041f366004611c84565b73ffffffffffffffffffffffffffffffffffffffff919091165f9081526003602090815260408083209383529290522080546001909101549091565b348015610466575f80fd5b506103f7610cac565b34801561047a575f80fd5b50610154610489366004611db8565b610ce0565b610496610d40565b5f8473ffffffffffffffffffffffffffffffffffffffff168484846040516104bf929190611dd1565b5f6040518083038185875af1925050503d805f81146104f9576040519150601f19603f3d011682016040523d82523d5f602084013e6104fe565b606091505b505090508061056e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f43616c6c206661696c656400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee11614610614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4272696265496e69746961746976653a20696e76616c69642d73656e646572006044820152606401610565565b7f0000000000000000000000006440f144b7e50d6a8439336510312d2f54beb01d73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61066f60045473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018490526044016020604051808303815f875af11580156106de573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107029190611de0565b50817f558c9e62ff2d14635d948d5dc2ebad6b5d4ddb24ba7e6f3039ca5b6ae22e17428260405161073591815260200190565b60405180910390a25050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee116146107e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4272696265496e69746961746976653a20696e76616c69642d73656e646572006044820152606401610565565b50565b5f7f000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee173ffffffffffffffffffffffffffffffffffffffff1663900cf0cf6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561084d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108719190611dff565b905080821015610903576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4272696265496e69746961746976653a206e6f772d6f722d6675747572652d6560448201527f706f6368730000000000000000000000000000000000000000000000000000006064820152608401610565565b5f8281526020819052604081208054869290610920908490611e43565b90915550505f8281526020819052604081206001018054859290610945908490611e43565b90915550506040805133815260208101869052908101849052606081018390527f8da751404c1c12bd225230d318ca0913aab7a5f98c004ae97cf1b7072e7f119d9060800160405180910390a16109d473ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000006440f144b7e50d6a8439336510312d2f54beb01d16333087610d93565b610a1673ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000004c46e830bb56ce22735d5d8fc9cb90309317d0f16333086610d93565b50505050565b610a24610d40565b610a2d5f610e1c565b565b5f805f5b83811015610aab575f858583818110610a4e57610a4e611e56565b905060600201803603810190610a649190611e83565b90505f80610a7f33845f015185602001518660400151610e92565b9092509050610a8e8287611e43565b9550610a9a8186611e43565b94505060019092019150610a339050565b508115610af357610af373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000006440f144b7e50d6a8439336510312d2f54beb01d1633846115c5565b8015610b3a57610b3a73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000004c46e830bb56ce22735d5d8fc9cb90309317d0f1633836115c5565b9250929050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee11614610be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4272696265496e69746961746976653a20696e76616c69642d73656e646572006044820152606401610565565b73ffffffffffffffffffffffffffffffffffffffff84165f90815260036020908152604080832083805282529091206002908101549082527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077d549091610c5190889085359086013582851415611608565b610c668688863560208801358683141561167f565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260036020908152604080832083805290915281206002015481905b9392505050565b5f80805260026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077d5481905b92915050565b610ce8610d40565b73ffffffffffffffffffffffffffffffffffffffff8116610d37576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f6004820152602401610565565b6107e081610e1c565b60045473ffffffffffffffffffffffffffffffffffffffff163314610a2d576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610565565b60405173ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260648201839052610a169186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061175b565b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f807f000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee173ffffffffffffffffffffffffffffffffffffffff1663900cf0cf6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610efd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f219190611dff565b8510610faf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4272696265496e69746961746976653a2063616e6e6f742d636c61696d2d666f60448201527f722d63757272656e742d65706f636800000000000000000000000000000000006064820152608401610565565b73ffffffffffffffffffffffffffffffffffffffff86165f90815260016020908152604080832088845290915290205460ff1615611049576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4272696265496e69746961746976653a20616c72656164792d636c61696d65646044820152606401610565565b5f8581526020818152604091829020825160608101845281548082526001830154938201939093526002909101549281019290925215158061108e5750602081015115155b6110f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4272696265496e69746961746976653a206e6f2d6272696265000000000000006044820152606401610565565b73ffffffffffffffffffffffffffffffffffffffff87165f90815260036020526040812061112290876117ef565b90508686111580156111435750868160600151118061114357506060810151155b6111cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f4272696265496e69746961746976653a20696e76616c69642d707265762d6c7160448201527f74792d616c6c6f636174696f6e2d65706f6368000000000000000000000000006064820152608401610565565b5f6111db6002876117ef565b90508786111580156111fc575087816060015111806111fc57506060810151155b611288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f4272696265496e69746961746976653a20696e76616c69642d707265762d746f60448201527f74616c2d6c7174792d616c6c6f636174696f6e2d65706f6368000000000000006064820152608401610565565b8051611316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4272696265496e69746961746976653a20746f74616c2d6c7174792d616c6c6f60448201527f636174696f6e2d7a65726f0000000000000000000000000000000000000000006064820152608401610565565b81516113a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4272696265496e69746961746976653a206c7174792d616c6c6f636174696f6e60448201527f2d7a65726f0000000000000000000000000000000000000000000000000000006064820152608401610565565b5f6113cf7f0000000000000000000000000000000000000000000000000000000000093a808a611f02565b6113f9907f00000000000000000000000000000000000000000000000000000000681bf400611e43565b90505f61140e835f0151838560200151611856565b90505f611423855f0151848760200151611856565b90505f8660400151836114369190611f19565b90508082885f01516114489190611f02565b6114529190611f2c565b9850808288602001516114659190611f02565b61146f9190611f2c565b975088875f018181516114829190611f19565b905250602087018051899190611499908390611f19565b9052506040870180518391906114b0908390611e43565b91508181525050865f808e81526020019081526020015f205f820151815f015560208201518160010155604082015181600201559050506001805f8f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8e81526020019081526020015f205f6101000a81548160ff0219169083151502179055507f520304589c9512f04f4c28f0a5f365d2620fea83386850175628ebfe3d52b6838d8d8b8b6040516115ad949392919073ffffffffffffffffffffffffffffffffffffffff94909416845260208401929092526040830152606082015260800190565b60405180910390a15050505050505094509492505050565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261160391859182169063a9059cbb90606401610dd5565b505050565b80156116215761161c60028585855f611884565b611638565b5f8481526002602052604090208381556001018290555b60408051858152602081018590529081018390527ff3585f583ce8a74a5f014115d0a23ad6246464e971fe5701465b9976dc9c5bcd9060600160405180910390a150505050565b80156116bd5773ffffffffffffffffffffffffffffffffffffffff85165f9081526003602052604081206116b891869086908690611884565b6116f6565b73ffffffffffffffffffffffffffffffffffffffff85165f90815260036020908152604080832087845290915290208381556001018290555b6040805173ffffffffffffffffffffffffffffffffffffffff8716815260208101869052908101849052606081018390527f3cf1dea48fd0f5e4db76fa66b9f662a7a8e3c185f34763189efc609691e327529060800160405180910390a15050505050565b5f61177c73ffffffffffffffffffffffffffffffffffffffff84168361195a565b905080515f141580156117a057508080602001905181019061179e9190611de0565b155b15611603576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610565565b61181660405180608001604052805f81526020015f81526020015f81526020015f81525090565b505f908152602091825260409081902081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015290565b5f806118628486611f02565b9050828111611871575f61187b565b61187b8382611f19565b95945050505050565b61188e8585611967565b156118c5576040517f3c57789e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80158015906118db57506118d98582611967565b155b15611912576040517fac9c4cae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f818152602095909552604080862060029081018054808952838920600390810189905591889055968852919096209586019490945592840192909255825560019190910155565b6060610ca583835f6119ec565b5f815f036119a1576040517fee7efd5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152602084905260409020600201541515806119ce57505f8281526020849052604090206003015415155b80610ca55750505f8080526020929092526040909120600301541490565b606081471015611a2a576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610565565b5f808573ffffffffffffffffffffffffffffffffffffffff168486604051611a529190611f64565b5f6040518083038185875af1925050503d805f8114611a8c576040519150601f19603f3d011682016040523d82523d5f602084013e611a91565b606091505b5091509150611aa1868383611aab565b9695505050505050565b606082611ac057611abb82611b3a565b610ca5565b8151158015611ae4575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611b33576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610565565b5080610ca5565b805115611b4a5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b803573ffffffffffffffffffffffffffffffffffffffff81168114611b9f575f80fd5b919050565b5f805f8060608587031215611bb7575f80fd5b611bc085611b7c565b935060208501359250604085013567ffffffffffffffff80821115611be3575f80fd5b818701915087601f830112611bf6575f80fd5b813581811115611c04575f80fd5b886020828501011115611c15575f80fd5b95989497505060200194505050565b5f8060408385031215611c35575f80fd5b50508035926020909101359150565b5f60208284031215611c54575f80fd5b5035919050565b5f805f60608486031215611c6d575f80fd5b505081359360208301359350604090920135919050565b5f8060408385031215611c95575f80fd5b611c9e83611b7c565b946020939093013593505050565b5f8060208385031215611cbd575f80fd5b823567ffffffffffffffff80821115611cd4575f80fd5b818501915085601f830112611ce7575f80fd5b813581811115611cf5575f80fd5b866020606083028501011115611d09575f80fd5b60209290920196919550909350505050565b5f60a08284031215611d2b575f80fd5b50919050565b5f805f805f858703610200811215611d47575f80fd5b86359550611d5760208801611b7c565b945060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215611d88575f80fd5b50604086019250611d9c8760c08801611d1b565b9150611dac876101608801611d1b565b90509295509295909350565b5f60208284031215611dc8575f80fd5b610ca582611b7c565b818382375f9101908152919050565b5f60208284031215611df0575f80fd5b81518015158114610ca5575f80fd5b5f60208284031215611e0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610cda57610cda611e16565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60608284031215611e93575f80fd5b6040516060810181811067ffffffffffffffff82111715611edb577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b80604052508235815260208301356020820152604083013560408201528091505092915050565b8082028115828204841417610cda57610cda611e16565b81810381811115610cda57610cda611e16565b5f82611f5f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f82515f5b81811015611f835760208186018101518583015201611f69565b505f92019182525091905056fea2646970667358221220066b21d881425daccdd07bad527b07260a2e6ddd486cc1917ff877cc271bf1d964736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee10000000000000000000000006440f144b7e50d6a8439336510312d2f54beb01d00000000000000000000000004c46e830bb56ce22735d5d8fc9cb90309317d0f
-----Decoded View---------------
Arg [0] : _governance (address): 0x807DEf5E7d057DF05C796F4bc75C3Fe82Bd6EeE1
Arg [1] : _bold (address): 0x6440f144b7e50D6a8439336510312d2F54beB01D
Arg [2] : _bribeToken (address): 0x04C46E830Bb56ce22735d5d8Fc9CB90309317d0f
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000807def5e7d057df05c796f4bc75c3fe82bd6eee1
Arg [1] : 0000000000000000000000006440f144b7e50d6a8439336510312d2f54beb01d
Arg [2] : 00000000000000000000000004c46e830bb56ce22735d5d8fc9cb90309317d0f
Loading...
Loading
Loading...
Loading
Net Worth in USD
$10,626.62
Net Worth in ETH
5.386516
Token Allocations
BOLD
100.00%
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $1 | 10,584.2812 | $10,626.62 |
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.