Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Create Default P... | 12390861 | 2 days ago | IN | 0 S | 0.2037761 |
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
12390861 | 2 days ago | Contract Creation | 0 S |
Loading...
Loading
Contract Name:
StakedSonicSymphonyPluginFactory
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "./StakedSonicSymphonyPlugin.sol"; /** * @title StakedSonicSymphonyPluginFactory * @author akita * * Factory contract for creating StakedSonicSymphonyPlugin instances. * This factory is specifically designed for the Staked Sonic Symphony (bpt-sss) pool. */ contract StakedSonicSymphonyPluginFactory { // Constants for the Staked Sonic Symphony pool address public constant BPT_TOKEN = 0x374641076B68371e69D03C417DAc3E5F236c32FA; // Pool address address public constant BALANCER_GAUGE = 0x8476F3A8DA52092e7835167AFe27835dC171C133; // Incentives gauge address public constant STS_TOKEN = 0xE5DA20F15420aD15DE0fa650600aFc998bbE3955; // stS token (rate provider) address public immutable VOTER; address public last_plugin; event Plugin__PluginCreated(address plugin); constructor(address _VOTER) { VOTER = _VOTER; } /** * @notice Creates a new StakedSonicSymphonyPlugin * @param _rewardTokens Array of reward tokens from the gauge (if known) * @return Address of the newly created plugin */ function createPlugin(address[] memory _rewardTokens) external returns (address) { // Define tokens in the underlying pool address[] memory tokensInUnderlying = new address[](1); tokensInUnderlying[0] = STS_TOKEN; // Use provided reward tokens or default to STS if none provided address[] memory bribeTokens = _rewardTokens.length > 0 ? _rewardTokens : tokensInUnderlying; // Create the plugin StakedSonicSymphonyPlugin lastPlugin = new StakedSonicSymphonyPlugin( BPT_TOKEN, VOTER, tokensInUnderlying, bribeTokens, BALANCER_GAUGE ); last_plugin = address(lastPlugin); emit Plugin__PluginCreated(last_plugin); return last_plugin; } /** * @notice Creates a new StakedSonicSymphonyPlugin with default settings * @return Address of the newly created plugin */ function createDefaultPlugin() external returns (address) { // Define tokens in the underlying pool address[] memory tokensInUnderlying = new address[](1); tokensInUnderlying[0] = STS_TOKEN; // Define bribe tokens (using the same tokens as in the underlying pool as default) address[] memory bribeTokens = new address[](1); bribeTokens[0] = STS_TOKEN; // Create the plugin StakedSonicSymphonyPlugin lastPlugin = new StakedSonicSymphonyPlugin( BPT_TOKEN, VOTER, tokensInUnderlying, bribeTokens, BALANCER_GAUGE ); last_plugin = address(lastPlugin); emit Plugin__PluginCreated(last_plugin); return last_plugin; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @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. */ 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]. */ 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 v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @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); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @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.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @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.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IBribe { /*---------- FUNCTIONS --------------------------------------------*/ function getReward(address account) external; function notifyRewardAmount(address token, uint amount) external; /*---------- RESTRICTED FUNCTIONS ---------------------------------*/ function _deposit(uint amount, address account) external; function _withdraw(uint amount, address account) external; function addReward(address rewardToken) external; /*---------- VIEW FUNCTIONS ---------------------------------------*/ function balanceOf(address account) external view returns (uint256); function totalSupply() external view returns (uint256); function rewardPerToken(address reward) external view returns (uint); function getRewardForDuration(address reward) external view returns (uint); function left(address reward) external view returns (uint); function earned(address account, address reward) external view returns (uint); function getRewardTokens() external view returns (address[] memory); function DURATION() external view returns (uint); function isRewardToken(address token) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IGauge { /*---------- FUNCTIONS --------------------------------------------*/ function getReward(address account) external; function notifyRewardAmount(address token, uint amount) external; /*---------- RESTRICTED FUNCTIONS ---------------------------------*/ function _deposit(address account, uint256 amount) external; function _withdraw(address account, uint256 amount) external; function addReward(address rewardToken) external; /*---------- VIEW FUNCTIONS ---------------------------------------*/ function balanceOf(address account) external view returns (uint256); function totalSupply() external view returns (uint256); function rewardPerToken(address reward) external view returns (uint); function getRewardForDuration(address reward) external view returns (uint); function earned(address account, address reward) external view returns (uint); function left(address token) external view returns (uint); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IVoter { /*---------- FUNCTIONS --------------------------------------------*/ function distribute(address _gauge) external; function emitDeposit(address account, uint amount) external; function emitWithdraw(address account, uint amount) external; function notifyRewardAmount(uint amount) external; /*---------- RESTRICTED FUNCTIONS ---------------------------------*/ /*---------- VIEW FUNCTIONS ---------------------------------------*/ function OTOKEN() external view returns (address); function plugins(uint256 index) external view returns (address); function getPlugins() external view returns (address[] memory); function gauges(address pool) external view returns (address); function bribes(address pool) external view returns (address); function isAlive(address gauge) external view returns (bool); function usedWeights(address account) external view returns (uint256); function weights(address pool) external view returns (uint256); function totalWeight() external view returns (uint256); function votes(address account, address pool) external view returns (uint256); function lastVoted(address account) external view returns (uint256); function minter() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "contracts/interfaces/IGauge.sol"; import "contracts/interfaces/IBribe.sol"; import "contracts/interfaces/IVoter.sol"; /** * @title Plugin * @author heesho * * Plugins are contracts that can be used to integrate a yield-bearing asset with the Voting system. * The idea is that when a yield-bearing asset is added to this system, users can deposit it in a Plugin * to earn OTOKEN rewards. The Plugin will strip the yield from the yield-bearing asset and distribute it * as a voting reward to VTOKEN holders that voted for the Plugin. The Plugin contract is in charge of * accepting deposits/withdrawals from accounts and updating their balances in the corresponding Gauge contract * so that they can receive OTOKEN rewards. The Plugin is also in charge of harvesting yield from the yield-bearing * asset (underlying) and distributing that yield to its corresponding Bribe contract. * * Plugin balanceOf must be equal to Gauge balanceOf for all users at all times. * Plugin totalSupply must be equal to Gauge totalSupply at all times. */ abstract contract Plugin is ReentrancyGuard { using SafeERC20 for IERC20Metadata; /*---------- CONSTANTS --------------------------------------------*/ /*---------- STATE VARIABLES --------------------------------------*/ IERC20Metadata private immutable underlying; address private immutable OTOKEN; address private immutable voter; address private gauge; address private bribe; string private protocol; address[] private tokensInUnderlying; address[] private bribeTokens; uint256 private _totalSupply; mapping(address => uint256) private _balances; /*---------- ERRORS ------------------------------------------------*/ error Plugin__InvalidZeroInput(); error Plugin__NotAuthorizedVoter(); /*---------- EVENTS ------------------------------------------------*/ event Plugin__Deposited(address indexed account, uint256 amount); event Plugin__Withdrawn(address indexed account, uint256 amount); event Plugin__ClaimedAnDistributed(); /*---------- MODIFIERS --------------------------------------------*/ modifier nonZeroInput(uint256 _amount) { if (_amount == 0) revert Plugin__InvalidZeroInput(); _; } modifier onlyVoter() { if (msg.sender != voter) revert Plugin__NotAuthorizedVoter(); _; } /*---------- FUNCTIONS --------------------------------------------*/ constructor( address _underlying, address _voter, address[] memory _tokensInUnderlying, address[] memory _bribeTokens, string memory _protocol ) { underlying = IERC20Metadata(_underlying); voter = _voter; tokensInUnderlying = _tokensInUnderlying; bribeTokens = _bribeTokens; protocol = _protocol; OTOKEN = IVoter(_voter).OTOKEN(); } function depositFor(address account, uint256 amount) public virtual nonReentrant nonZeroInput(amount) { _totalSupply = _totalSupply + amount; _balances[account] = _balances[account] + amount; emit Plugin__Deposited(account, amount); underlying.safeTransferFrom(msg.sender, address(this), amount); IGauge(gauge)._deposit(account, amount); } function withdrawTo(address account, uint256 amount) public virtual nonReentrant nonZeroInput(amount) { _totalSupply = _totalSupply - amount; _balances[msg.sender] = _balances[msg.sender] - amount; emit Plugin__Withdrawn(msg.sender, amount); IGauge(gauge)._withdraw(msg.sender, amount); underlying.safeTransfer(account, amount); } function claimAndDistribute() public virtual nonReentrant { emit Plugin__ClaimedAnDistributed(); } /*---------- RESTRICTED FUNCTIONS ---------------------------------*/ function setGauge(address _gauge) external onlyVoter { gauge = _gauge; } function setBribe(address _bribe) external onlyVoter { bribe = _bribe; } /*---------- VIEW FUNCTIONS ---------------------------------------*/ function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function totalSupply() public view returns (uint256) { return _totalSupply; } function getUnderlyingName() public view virtual returns (string memory) { return underlying.name(); } function getUnderlyingSymbol() public view virtual returns (string memory) { return underlying.symbol(); } function getUnderlyingAddress() public view virtual returns (address) { return address(underlying); } function getUnderlyingDecimals() public view virtual returns (uint8) { return underlying.decimals(); } function getProtocol() public view virtual returns (string memory) { return protocol; } function getVoter() public view returns (address) { return voter; } function getGauge() public view returns (address) { return gauge; } function getBribe() public view returns (address) { return bribe; } function getTokensInUnderlying() public view virtual returns (address[] memory) { return tokensInUnderlying; } function getBribeTokens() public view returns (address[] memory) { return bribeTokens; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "contracts/Plugin.sol"; import "contracts/interfaces/IBribe.sol"; // Interface for Balancer V2 Gauge interface IBalancerGauge { function claim_rewards(address _addr) external; } // Interface for Balancer V2 Pool interface IBalancerPool { function getPoolId() external view returns (bytes32); function symbol() external view returns (string memory); function name() external view returns (string memory); } /** * @title BalancerV2Plugin * @author akita * * Plugin for Balancer V2 pools that allows users to deposit BPTs (Balancer Pool Tokens) * and earn OTOKEN rewards. The plugin claims rewards from the Balancer gauge and * distributes them to the bribe contract. */ contract BalancerV2Plugin is Plugin { using SafeERC20 for IERC20; /*---------- STATE VARIABLES --------------------------------------*/ address public immutable balancerGauge; bytes32 public immutable poolId; string private poolSymbol; string private poolName; /*---------- ERRORS ------------------------------------------------*/ error BalancerV2Plugin__InvalidGauge(); /*---------- FUNCTIONS --------------------------------------------*/ constructor( address _underlying, // BPT token address address _voter, address[] memory _tokensInUnderlying, address[] memory _bribeTokens, string memory _protocol, address _balancerGauge ) Plugin( _underlying, _voter, _tokensInUnderlying, _bribeTokens, _protocol ) { balancerGauge = _balancerGauge; poolId = IBalancerPool(_underlying).getPoolId(); poolSymbol = IBalancerPool(_underlying).symbol(); poolName = IBalancerPool(_underlying).name(); } /** * @notice Claims rewards from the Balancer gauge and distributes them to the bribe contract */ function claimAndDistribute() public virtual override { super.claimAndDistribute(); // 1. Claim rewards from the Balancer gauge if (balancerGauge != address(0)) { try IBalancerGauge(balancerGauge).claim_rewards(address(this)) {} catch {} } // 2. Distribute claimed rewards to the bribe contract address bribe = getBribe(); for (uint i = 0; i < getBribeTokens().length; i++) { address token = getBribeTokens()[i]; uint256 balance = IERC20(token).balanceOf(address(this)); if (balance > 0) { IERC20(token).safeApprove(bribe, 0); IERC20(token).safeApprove(bribe, balance); IBribe(bribe).notifyRewardAmount(token, balance); } } } /*---------- VIEW FUNCTIONS ---------------------------------------*/ function getUnderlyingName() public view override returns (string memory) { return poolName; } function getUnderlyingSymbol() public view override returns (string memory) { return poolSymbol; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "./BalancerV2Plugin.sol"; /** * @title StakedSonicSymphonyPlugin * @author akita * * A specialized plugin for the Staked Sonic Symphony (bpt-sss) Balancer V2 pool. * This plugin extends the BalancerV2Plugin with specific functionality for the * Staked Sonic Symphony pool. */ contract StakedSonicSymphonyPlugin is BalancerV2Plugin { /*---------- CONSTANTS --------------------------------------------*/ // Pool-specific constants uint256 public constant SWAP_FEE = 1000000000000000; // 0.1% (in 1e18 format) uint256 public constant AMP_FACTOR = 400; string public constant POOL_TYPE = "Stable"; /*---------- FUNCTIONS --------------------------------------------*/ constructor( address _underlying, // BPT token address (0x374641076b68371e69d03c417dac3e5f236c32fa) address _voter, address[] memory _tokensInUnderlying, address[] memory _bribeTokens, address _balancerGauge // Incentives gauge (0x8476f3a8da52092e7835167afe27835dc171c133) ) BalancerV2Plugin( _underlying, _voter, _tokensInUnderlying, _bribeTokens, "Balancer V2 - Staked Sonic Symphony", _balancerGauge ) { // Any additional initialization specific to this pool } /** * @notice Claims rewards from the Balancer gauge and distributes them to the bribe contract * This implementation includes any specific logic needed for the Staked Sonic Symphony pool */ function claimAndDistribute() public override { // Call the parent implementation super.claimAndDistribute(); // Add any additional logic specific to the Staked Sonic Symphony pool // For example, handling specific reward tokens or custom distribution logic } /*---------- VIEW FUNCTIONS ---------------------------------------*/ /** * @notice Returns additional information about the pool * @return Pool type (Stable) */ function getPoolType() public pure returns (string memory) { return POOL_TYPE; } /** * @notice Returns the swap fee of the pool * @return Swap fee (0.1%) */ function getSwapFee() public pure returns (uint256) { return SWAP_FEE; } /** * @notice Returns the AMP factor of the pool * @return AMP factor (400) */ function getAmpFactor() public pure returns (uint256) { return AMP_FACTOR; } }
{ "optimizer": { "enabled": true, "runs": 200, "details": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_VOTER","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"plugin","type":"address"}],"name":"Plugin__PluginCreated","type":"event"},{"inputs":[],"name":"BALANCER_GAUGE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BPT_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STS_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VOTER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"createDefaultPlugin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_rewardTokens","type":"address[]"}],"name":"createPlugin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"last_plugin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b5060405161213938038061213983398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516120a0610099600039600081816101070152818161024a01526103c301526120a06000f3fe60806040523480156200001157600080fd5b5060043610620000875760003560e01c806341cb88f2116200006257806341cb88f214620000ea5780638ebf2fd6146200010157806395e0d7d71462000129578063f3018ff3146200013d57600080fd5b806309611fc8146200008c5780630964022214620000b25780631fc170b614620000ce575b600080fd5b6200009662000159565b6040516001600160a01b03909116815260200160405180910390f35b6200009673374641076b68371e69d03c417dac3e5f236c32fa81565b6200009673e5da20f15420ad15de0fa650600afc998bbe395581565b62000096620000fb366004620004df565b62000324565b620000967f000000000000000000000000000000000000000000000000000000000000000081565b60005462000096906001600160a01b031681565b62000096738476f3a8da52092e7835167afe27835dc171c13381565b6040805160018082528183019092526000918291906020808301908036833701905050905073e5da20f15420ad15de0fa650600afc998bbe395581600081518110620001a957620001a9620005b2565b6001600160a01b03929092166020928302919091019091015260408051600180825281830190925260009181602001602082028036833701905050905073e5da20f15420ad15de0fa650600afc998bbe395581600081518110620002115762000211620005b2565b60200260200101906001600160a01b031690816001600160a01b031681525050600073374641076b68371e69d03c417dac3e5f236c32fa7f00000000000000000000000000000000000000000000000000000000000000008484738476f3a8da52092e7835167afe27835dc171c1336040516200028e906200049e565b6200029e9594939291906200060e565b604051809103906000f080158015620002bb573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0383169081179091556040519081529091507f8bd8d02ab586fc3199adbf0e317d441f4b5b40672174d96b6d805f3b2b3e48e39060200160405180910390a150506000546001600160a01b031692915050565b6040805160018082528183019092526000918291906020808301908036833701905050905073e5da20f15420ad15de0fa650600afc998bbe395581600081518110620003745762000374620005b2565b60200260200101906001600160a01b031690816001600160a01b031681525050600080845111620003a65781620003a8565b835b9050600073374641076b68371e69d03c417dac3e5f236c32fa7f00000000000000000000000000000000000000000000000000000000000000008484738476f3a8da52092e7835167afe27835dc171c13360405162000407906200049e565b620004179594939291906200060e565b604051809103906000f08015801562000434573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0383169081179091556040519081529091507f8bd8d02ab586fc3199adbf0e317d441f4b5b40672174d96b6d805f3b2b3e48e39060200160405180910390a150506000546001600160a01b03169392505050565b611a06806200066583390190565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b0381168114620004da57600080fd5b919050565b60006020808385031215620004f357600080fd5b823567ffffffffffffffff808211156200050c57600080fd5b818501915085601f8301126200052157600080fd5b813581811115620005365762000536620004ac565b8060051b604051601f19603f830116810181811085821117156200055e576200055e620004ac565b6040529182528482019250838101850191888311156200057d57600080fd5b938501935b82851015620005a6576200059685620004c2565b8452938501939285019262000582565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b83811015620006035781516001600160a01b031687529582019590820190600101620005dc565b509495945050505050565b600060018060a01b038088168352808716602084015260a060408401526200063a60a0840187620005c8565b83810360608501526200064e8187620005c8565b925050808416608084015250969550505050505056fe6101206040523480156200001257600080fd5b5060405162001a0638038062001a06833981016040819052620000359162000418565b84848484604051806060016040528060238152602001620019e36023913960016000556001600160a01b03808616608052841660c05282518690869086908690869086906200008c906004906020860190620002a0565b508151620000a2906005906020850190620002a0565b506003620000b182826200054a565b50836001600160a01b031663c544df0c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000117919062000616565b6001600160a01b0390811660a05286811660e0526040805163038fff2d60e41b81529051918d1696506338fff2d0955060048082019550602094509192508290030181865afa1580156200016f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200019591906200063b565b6101008181525050856001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620001dc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000206919081019062000655565b6008906200021590826200054a565b50856001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000255573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200027f919081019062000655565b6009906200028e90826200054a565b5050505050505050505050506200070b565b828054828255906000526020600020908101928215620002f8579160200282015b82811115620002f857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620002c1565b50620003069291506200030a565b5090565b5b808211156200030657600081556001016200030b565b80516001600160a01b03811681146200033957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200037f576200037f6200033e565b604052919050565b600082601f8301126200039957600080fd5b815160206001600160401b03821115620003b757620003b76200033e565b8160051b620003c882820162000354565b9283528481018201928281019087851115620003e357600080fd5b83870192505b848310156200040d57620003fd8362000321565b82529183019190830190620003e9565b979650505050505050565b600080600080600060a086880312156200043157600080fd5b6200043c8662000321565b94506200044c6020870162000321565b60408701519094506001600160401b03808211156200046a57600080fd5b6200047889838a0162000387565b945060608801519150808211156200048f57600080fd5b506200049e8882890162000387565b925050620004af6080870162000321565b90509295509295909350565b600181811c90821680620004d057607f821691505b602082108103620004f157634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200054557600081815260208120601f850160051c81016020861015620005205750805b601f850160051c820191505b8181101562000541578281556001016200052c565b5050505b505050565b81516001600160401b038111156200056657620005666200033e565b6200057e81620005778454620004bb565b84620004f7565b602080601f831160018114620005b657600084156200059d5750858301515b600019600386901b1c1916600185901b17855562000541565b600085815260208120601f198616915b82811015620005e757888601518255948401946001909101908401620005c6565b5085821015620006065787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200062957600080fd5b620006348262000321565b9392505050565b6000602082840312156200064e57600080fd5b5051919050565b600060208083850312156200066957600080fd5b82516001600160401b03808211156200068157600080fd5b818501915085601f8301126200069657600080fd5b815181811115620006ab57620006ab6200033e565b620006bf601f8201601f1916850162000354565b91508082528684828501011115620006d657600080fd5b60005b81811015620006f6578381018501518382018601528401620006d9565b50600090820190930192909252509392505050565b60805160a05160c05160e051610100516112656200077e600039600061023601526000818161020f01528181610a420152610a840152600081816101bf015281816106f701526108d4015260005050600081816102d10152818161055801528181610653015261075b01526112656000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806388a68682116100de578063d16352af11610097578063dfb89c3711610071578063dfb89c371461037d578063e33ca83914610385578063e81defce1461038d578063f2803f03146103a057600080fd5b8063d16352af14610360578063d4cadf6814610368578063df6b91b11461037557600080fd5b806388a68682146102cf5780638df972be146102f557806392081a4714610306578063987672c714610320578063b1942b1614610329578063cf9afab51461033e57600080fd5b80633e0dc34e116101305780633e0dc34e1461023157806355a68ed314610258578063648da8591461026b578063687f38931461029057806370a0823114610298578063768aebde146102c157600080fd5b8063068acc391461017857806318160ddd14610196578063205c2878146101a85780632b37f53c146101bd5780632f4f21e2146101f7578063367e5f3e1461020a575b600080fd5b6101806103b1565b60405161018d9190611022565b60405180910390f35b6006545b60405190815260200161018d565b6101bb6101b6366004611071565b610443565b005b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b03909116815260200161018d565b6101bb610205366004611071565b610590565b6101df7f000000000000000000000000000000000000000000000000000000000000000081565b61019a7f000000000000000000000000000000000000000000000000000000000000000081565b6101bb61026636600461109b565b6106ec565b61018060405180604001604052806006815260200165537461626c6560d01b81525081565b61019061019a565b61019a6102a636600461109b565b6001600160a01b031660009081526007602052604090205490565b61019a66038d7ea4c6800081565b7f00000000000000000000000000000000000000000000000000000000000000006101df565b6002546001600160a01b03166101df565b61030e610757565b60405160ff909116815260200161018d565b61019a61019081565b6103316107e0565b60405161018d91906110bd565b604080518082019091526006815265537461626c6560d01b6020820152610180565b610180610841565b66038d7ea4c6800061019a565b610180610850565b6101bb61085f565b610331610869565b6101bb61039b36600461109b565b6108c9565b6001546001600160a01b03166101df565b6060600880546103c09061110a565b80601f01602080910402602001604051908101604052809291908181526020018280546103ec9061110a565b80156104395780601f1061040e57610100808354040283529160200191610439565b820191906000526020600020905b81548152906001019060200180831161041c57829003601f168201915b5050505050905090565b61044b610934565b808060000361046d5760405163f6ec1bed60e01b815260040160405180910390fd5b8160065461047b919061115a565b6006553360009081526007602052604090205461049990839061115a565b33600081815260076020526040908190209290925590517f3d9b7cdf60349a62a2f52625a9697e0e2782b9ef0985bec5e10de869ec541ac5906104df9085815260200190565b60405180910390a260015460405163b790a77b60e01b8152336004820152602481018490526001600160a01b039091169063b790a77b90604401600060405180830381600087803b15801561053357600080fd5b505af1158015610547573d6000803e3d6000fd5b506105819250506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690508484610992565b5061058c6001600055565b5050565b610598610934565b80806000036105ba5760405163f6ec1bed60e01b815260040160405180910390fd5b816006546105c89190611173565b6006556001600160a01b0383166000908152600760205260409020546105ef908390611173565b6001600160a01b038416600081815260076020526040908190209290925590517f9a5084d92dfc874319b7345834de998ed1154f2ed11a4a6d353cf77a1bdb456e9061063e9085815260200190565b60405180910390a261067b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330856109fa565b600154604051631b684ce760e21b81526001600160a01b0385811660048301526024820185905290911690636da1339c90604401600060405180830381600087803b1580156106c957600080fd5b505af11580156106dd573d6000803e3d6000fd5b505050505061058c6001600055565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610735576040516366dce48d60e11b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107db9190611186565b905090565b6060600480548060200260200160405190810160405280929190818152602001828054801561043957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161081a575050505050905090565b6060600380546103c09061110a565b6060600980546103c09061110a565b610867610a38565b565b60606005805480602002602001604051908101604052809291908181526020018280548015610439576020028201919060005260206000209081546001600160a01b0316815260019091019060200180831161081a575050505050905090565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610912576040516366dce48d60e11b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60026000540361098b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600055565b6040516001600160a01b0383166024820152604481018290526109f590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610c49565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610a329085906323b872dd60e01b906084016109be565b50505050565b610a40610d1e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615610ae357604051634274debf60e11b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906384e9bd7e90602401600060405180830381600087803b158015610ad057600080fd5b505af1925050508015610ae1575060015b505b6000610af76002546001600160a01b031690565b905060005b610b04610869565b5181101561058c576000610b16610869565b8281518110610b2757610b276111a9565b60209081029190910101516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba091906111bf565b90508015610c3457610bbd6001600160a01b038316856000610d59565b610bd16001600160a01b0383168583610d59565b60405163b66503cf60e01b81526001600160a01b0383811660048301526024820183905285169063b66503cf90604401600060405180830381600087803b158015610c1b57600080fd5b505af1158015610c2f573d6000803e3d6000fd5b505050505b50508080610c41906111d8565b915050610afc565b6000610c9e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e6e9092919063ffffffff16565b9050805160001480610cbf575080806020019051810190610cbf91906111f1565b6109f55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610982565b610d26610934565b6040517f8fef40a30af028d208f06e01ada64f23e76ce003c6b015a945795b0cb268b53490600090a16108676001600055565b801580610dd35750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610dad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd191906111bf565b155b610e3e5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610982565b6040516001600160a01b0383166024820152604481018290526109f590849063095ea7b360e01b906064016109be565b6060610e7d8484600085610e85565b949350505050565b606082471015610ee65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610982565b600080866001600160a01b03168587604051610f029190611213565b60006040518083038185875af1925050503d8060008114610f3f576040519150601f19603f3d011682016040523d82523d6000602084013e610f44565b606091505b5091509150610f5587838387610f60565b979650505050505050565b60608315610fcf578251600003610fc8576001600160a01b0385163b610fc85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610982565b5081610e7d565b610e7d8383815115610fe45781518083602001fd5b8060405162461bcd60e51b81526004016109829190611022565b60005b83811015611019578181015183820152602001611001565b50506000910152565b6020815260008251806020840152611041816040850160208701610ffe565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461106c57600080fd5b919050565b6000806040838503121561108457600080fd5b61108d83611055565b946020939093013593505050565b6000602082840312156110ad57600080fd5b6110b682611055565b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156110fe5783516001600160a01b0316835292840192918401916001016110d9565b50909695505050505050565b600181811c9082168061111e57607f821691505b60208210810361113e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561116d5761116d611144565b92915050565b8082018082111561116d5761116d611144565b60006020828403121561119857600080fd5b815160ff811681146110b657600080fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156111d157600080fd5b5051919050565b6000600182016111ea576111ea611144565b5060010190565b60006020828403121561120357600080fd5b815180151581146110b657600080fd5b60008251611225818460208701610ffe565b919091019291505056fea26469706673582212205ba77525fb0954b491a8de45dfb147732630eb6859d62fc5acbef9871fdf611064736f6c6343000813003342616c616e636572205632202d205374616b656420536f6e69632053796d70686f6e79a26469706673582212206a990f61dba795c6b58b24b028e8af288fc622ee31a83807abb6626d965b10dd64736f6c63430008130033000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e
Deployed Bytecode
0x60806040523480156200001157600080fd5b5060043610620000875760003560e01c806341cb88f2116200006257806341cb88f214620000ea5780638ebf2fd6146200010157806395e0d7d71462000129578063f3018ff3146200013d57600080fd5b806309611fc8146200008c5780630964022214620000b25780631fc170b614620000ce575b600080fd5b6200009662000159565b6040516001600160a01b03909116815260200160405180910390f35b6200009673374641076b68371e69d03c417dac3e5f236c32fa81565b6200009673e5da20f15420ad15de0fa650600afc998bbe395581565b62000096620000fb366004620004df565b62000324565b620000967f000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e81565b60005462000096906001600160a01b031681565b62000096738476f3a8da52092e7835167afe27835dc171c13381565b6040805160018082528183019092526000918291906020808301908036833701905050905073e5da20f15420ad15de0fa650600afc998bbe395581600081518110620001a957620001a9620005b2565b6001600160a01b03929092166020928302919091019091015260408051600180825281830190925260009181602001602082028036833701905050905073e5da20f15420ad15de0fa650600afc998bbe395581600081518110620002115762000211620005b2565b60200260200101906001600160a01b031690816001600160a01b031681525050600073374641076b68371e69d03c417dac3e5f236c32fa7f000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e8484738476f3a8da52092e7835167afe27835dc171c1336040516200028e906200049e565b6200029e9594939291906200060e565b604051809103906000f080158015620002bb573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0383169081179091556040519081529091507f8bd8d02ab586fc3199adbf0e317d441f4b5b40672174d96b6d805f3b2b3e48e39060200160405180910390a150506000546001600160a01b031692915050565b6040805160018082528183019092526000918291906020808301908036833701905050905073e5da20f15420ad15de0fa650600afc998bbe395581600081518110620003745762000374620005b2565b60200260200101906001600160a01b031690816001600160a01b031681525050600080845111620003a65781620003a8565b835b9050600073374641076b68371e69d03c417dac3e5f236c32fa7f000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e8484738476f3a8da52092e7835167afe27835dc171c13360405162000407906200049e565b620004179594939291906200060e565b604051809103906000f08015801562000434573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0383169081179091556040519081529091507f8bd8d02ab586fc3199adbf0e317d441f4b5b40672174d96b6d805f3b2b3e48e39060200160405180910390a150506000546001600160a01b03169392505050565b611a06806200066583390190565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b0381168114620004da57600080fd5b919050565b60006020808385031215620004f357600080fd5b823567ffffffffffffffff808211156200050c57600080fd5b818501915085601f8301126200052157600080fd5b813581811115620005365762000536620004ac565b8060051b604051601f19603f830116810181811085821117156200055e576200055e620004ac565b6040529182528482019250838101850191888311156200057d57600080fd5b938501935b82851015620005a6576200059685620004c2565b8452938501939285019262000582565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b83811015620006035781516001600160a01b031687529582019590820190600101620005dc565b509495945050505050565b600060018060a01b038088168352808716602084015260a060408401526200063a60a0840187620005c8565b83810360608501526200064e8187620005c8565b925050808416608084015250969550505050505056fe6101206040523480156200001257600080fd5b5060405162001a0638038062001a06833981016040819052620000359162000418565b84848484604051806060016040528060238152602001620019e36023913960016000556001600160a01b03808616608052841660c05282518690869086908690869086906200008c906004906020860190620002a0565b508151620000a2906005906020850190620002a0565b506003620000b182826200054a565b50836001600160a01b031663c544df0c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000117919062000616565b6001600160a01b0390811660a05286811660e0526040805163038fff2d60e41b81529051918d1696506338fff2d0955060048082019550602094509192508290030181865afa1580156200016f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200019591906200063b565b6101008181525050856001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620001dc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000206919081019062000655565b6008906200021590826200054a565b50856001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000255573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200027f919081019062000655565b6009906200028e90826200054a565b5050505050505050505050506200070b565b828054828255906000526020600020908101928215620002f8579160200282015b82811115620002f857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620002c1565b50620003069291506200030a565b5090565b5b808211156200030657600081556001016200030b565b80516001600160a01b03811681146200033957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200037f576200037f6200033e565b604052919050565b600082601f8301126200039957600080fd5b815160206001600160401b03821115620003b757620003b76200033e565b8160051b620003c882820162000354565b9283528481018201928281019087851115620003e357600080fd5b83870192505b848310156200040d57620003fd8362000321565b82529183019190830190620003e9565b979650505050505050565b600080600080600060a086880312156200043157600080fd5b6200043c8662000321565b94506200044c6020870162000321565b60408701519094506001600160401b03808211156200046a57600080fd5b6200047889838a0162000387565b945060608801519150808211156200048f57600080fd5b506200049e8882890162000387565b925050620004af6080870162000321565b90509295509295909350565b600181811c90821680620004d057607f821691505b602082108103620004f157634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200054557600081815260208120601f850160051c81016020861015620005205750805b601f850160051c820191505b8181101562000541578281556001016200052c565b5050505b505050565b81516001600160401b038111156200056657620005666200033e565b6200057e81620005778454620004bb565b84620004f7565b602080601f831160018114620005b657600084156200059d5750858301515b600019600386901b1c1916600185901b17855562000541565b600085815260208120601f198616915b82811015620005e757888601518255948401946001909101908401620005c6565b5085821015620006065787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200062957600080fd5b620006348262000321565b9392505050565b6000602082840312156200064e57600080fd5b5051919050565b600060208083850312156200066957600080fd5b82516001600160401b03808211156200068157600080fd5b818501915085601f8301126200069657600080fd5b815181811115620006ab57620006ab6200033e565b620006bf601f8201601f1916850162000354565b91508082528684828501011115620006d657600080fd5b60005b81811015620006f6578381018501518382018601528401620006d9565b50600090820190930192909252509392505050565b60805160a05160c05160e051610100516112656200077e600039600061023601526000818161020f01528181610a420152610a840152600081816101bf015281816106f701526108d4015260005050600081816102d10152818161055801528181610653015261075b01526112656000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806388a68682116100de578063d16352af11610097578063dfb89c3711610071578063dfb89c371461037d578063e33ca83914610385578063e81defce1461038d578063f2803f03146103a057600080fd5b8063d16352af14610360578063d4cadf6814610368578063df6b91b11461037557600080fd5b806388a68682146102cf5780638df972be146102f557806392081a4714610306578063987672c714610320578063b1942b1614610329578063cf9afab51461033e57600080fd5b80633e0dc34e116101305780633e0dc34e1461023157806355a68ed314610258578063648da8591461026b578063687f38931461029057806370a0823114610298578063768aebde146102c157600080fd5b8063068acc391461017857806318160ddd14610196578063205c2878146101a85780632b37f53c146101bd5780632f4f21e2146101f7578063367e5f3e1461020a575b600080fd5b6101806103b1565b60405161018d9190611022565b60405180910390f35b6006545b60405190815260200161018d565b6101bb6101b6366004611071565b610443565b005b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b03909116815260200161018d565b6101bb610205366004611071565b610590565b6101df7f000000000000000000000000000000000000000000000000000000000000000081565b61019a7f000000000000000000000000000000000000000000000000000000000000000081565b6101bb61026636600461109b565b6106ec565b61018060405180604001604052806006815260200165537461626c6560d01b81525081565b61019061019a565b61019a6102a636600461109b565b6001600160a01b031660009081526007602052604090205490565b61019a66038d7ea4c6800081565b7f00000000000000000000000000000000000000000000000000000000000000006101df565b6002546001600160a01b03166101df565b61030e610757565b60405160ff909116815260200161018d565b61019a61019081565b6103316107e0565b60405161018d91906110bd565b604080518082019091526006815265537461626c6560d01b6020820152610180565b610180610841565b66038d7ea4c6800061019a565b610180610850565b6101bb61085f565b610331610869565b6101bb61039b36600461109b565b6108c9565b6001546001600160a01b03166101df565b6060600880546103c09061110a565b80601f01602080910402602001604051908101604052809291908181526020018280546103ec9061110a565b80156104395780601f1061040e57610100808354040283529160200191610439565b820191906000526020600020905b81548152906001019060200180831161041c57829003601f168201915b5050505050905090565b61044b610934565b808060000361046d5760405163f6ec1bed60e01b815260040160405180910390fd5b8160065461047b919061115a565b6006553360009081526007602052604090205461049990839061115a565b33600081815260076020526040908190209290925590517f3d9b7cdf60349a62a2f52625a9697e0e2782b9ef0985bec5e10de869ec541ac5906104df9085815260200190565b60405180910390a260015460405163b790a77b60e01b8152336004820152602481018490526001600160a01b039091169063b790a77b90604401600060405180830381600087803b15801561053357600080fd5b505af1158015610547573d6000803e3d6000fd5b506105819250506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690508484610992565b5061058c6001600055565b5050565b610598610934565b80806000036105ba5760405163f6ec1bed60e01b815260040160405180910390fd5b816006546105c89190611173565b6006556001600160a01b0383166000908152600760205260409020546105ef908390611173565b6001600160a01b038416600081815260076020526040908190209290925590517f9a5084d92dfc874319b7345834de998ed1154f2ed11a4a6d353cf77a1bdb456e9061063e9085815260200190565b60405180910390a261067b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330856109fa565b600154604051631b684ce760e21b81526001600160a01b0385811660048301526024820185905290911690636da1339c90604401600060405180830381600087803b1580156106c957600080fd5b505af11580156106dd573d6000803e3d6000fd5b505050505061058c6001600055565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610735576040516366dce48d60e11b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107db9190611186565b905090565b6060600480548060200260200160405190810160405280929190818152602001828054801561043957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161081a575050505050905090565b6060600380546103c09061110a565b6060600980546103c09061110a565b610867610a38565b565b60606005805480602002602001604051908101604052809291908181526020018280548015610439576020028201919060005260206000209081546001600160a01b0316815260019091019060200180831161081a575050505050905090565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610912576040516366dce48d60e11b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60026000540361098b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600055565b6040516001600160a01b0383166024820152604481018290526109f590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610c49565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610a329085906323b872dd60e01b906084016109be565b50505050565b610a40610d1e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615610ae357604051634274debf60e11b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906384e9bd7e90602401600060405180830381600087803b158015610ad057600080fd5b505af1925050508015610ae1575060015b505b6000610af76002546001600160a01b031690565b905060005b610b04610869565b5181101561058c576000610b16610869565b8281518110610b2757610b276111a9565b60209081029190910101516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba091906111bf565b90508015610c3457610bbd6001600160a01b038316856000610d59565b610bd16001600160a01b0383168583610d59565b60405163b66503cf60e01b81526001600160a01b0383811660048301526024820183905285169063b66503cf90604401600060405180830381600087803b158015610c1b57600080fd5b505af1158015610c2f573d6000803e3d6000fd5b505050505b50508080610c41906111d8565b915050610afc565b6000610c9e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e6e9092919063ffffffff16565b9050805160001480610cbf575080806020019051810190610cbf91906111f1565b6109f55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610982565b610d26610934565b6040517f8fef40a30af028d208f06e01ada64f23e76ce003c6b015a945795b0cb268b53490600090a16108676001600055565b801580610dd35750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610dad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd191906111bf565b155b610e3e5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610982565b6040516001600160a01b0383166024820152604481018290526109f590849063095ea7b360e01b906064016109be565b6060610e7d8484600085610e85565b949350505050565b606082471015610ee65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610982565b600080866001600160a01b03168587604051610f029190611213565b60006040518083038185875af1925050503d8060008114610f3f576040519150601f19603f3d011682016040523d82523d6000602084013e610f44565b606091505b5091509150610f5587838387610f60565b979650505050505050565b60608315610fcf578251600003610fc8576001600160a01b0385163b610fc85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610982565b5081610e7d565b610e7d8383815115610fe45781518083602001fd5b8060405162461bcd60e51b81526004016109829190611022565b60005b83811015611019578181015183820152602001611001565b50506000910152565b6020815260008251806020840152611041816040850160208701610ffe565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461106c57600080fd5b919050565b6000806040838503121561108457600080fd5b61108d83611055565b946020939093013593505050565b6000602082840312156110ad57600080fd5b6110b682611055565b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156110fe5783516001600160a01b0316835292840192918401916001016110d9565b50909695505050505050565b600181811c9082168061111e57607f821691505b60208210810361113e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561116d5761116d611144565b92915050565b8082018082111561116d5761116d611144565b60006020828403121561119857600080fd5b815160ff811681146110b657600080fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156111d157600080fd5b5051919050565b6000600182016111ea576111ea611144565b5060010190565b60006020828403121561120357600080fd5b815180151581146110b657600080fd5b60008251611225818460208701610ffe565b919091019291505056fea26469706673582212205ba77525fb0954b491a8de45dfb147732630eb6859d62fc5acbef9871fdf611064736f6c6343000813003342616c616e636572205632202d205374616b656420536f6e69632053796d70686f6e79a26469706673582212206a990f61dba795c6b58b24b028e8af288fc622ee31a83807abb6626d965b10dd64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e
-----Decoded View---------------
Arg [0] : _VOTER (address): 0xB85213e2be9fd369Eb502532d0Ae9a8Fc1D8883E
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ 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.