Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Latest 2 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
1007635 | 6 hrs ago | Contract Creation | 0 S | |||
458243 | 5 days ago | Contract Creation | 0 S |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ChildChainGaugeFactory
Compiler Version
v0.7.0+commit.9e61f92b
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "./interfaces/IChildChainGauge.sol"; import "./Version.sol"; import "./BaseGaugeFactory.sol"; contract ChildChainGaugeFactory is Version, BaseGaugeFactory { string private _productVersion; constructor( IChildChainGauge gaugeImplementation, string memory factoryVersion, string memory productVersion ) Version(factoryVersion) BaseGaugeFactory(address(gaugeImplementation)) { require(keccak256(abi.encodePacked(gaugeImplementation.version())) == keccak256(abi.encodePacked(productVersion)), "VERSION_MISMATCH"); _productVersion = productVersion; } /** * @notice Returns a JSON representation of the deployed gauge version containing name, version number and task ID. * * @dev This value will only be updated at factory creation time. */ function getProductVersion() public view returns (string memory) { return _productVersion; } /** * @notice Deploys a new gauge for a Balancer pool. * @dev As anyone can register arbitrary Balancer pools with the Vault, * it's impossible to prove onchain that `pool` is a "valid" deployment. * * Care must be taken to ensure that gauges deployed from this factory are suitable to distribute rewards. * * It is possible to deploy multiple gauges for a single pool. * @param pool The address of the pool for which to deploy a gauge * @return The address of the deployed gauge */ function create(address pool) external returns (address) { address gauge = _create(); IChildChainGauge(gauge).initialize(pool, getProductVersion()); return gauge; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.7.0; import "./interfaces/ILiquidityGaugeFactory.sol"; import "./Clones.sol"; abstract contract BaseGaugeFactory is ILiquidityGaugeFactory { address private _gaugeImplementation; mapping(address => bool) private _isGaugeFromFactory; event GaugeCreated(address indexed gauge); constructor(address gaugeImplementation) { _gaugeImplementation = gaugeImplementation; } /** * @notice Returns the address of the implementation used for gauge deployments. */ function getGaugeImplementation() public view returns (address) { return _gaugeImplementation; } /** * @notice Returns true if `gauge` was created by this factory. */ function isGaugeFromFactory(address gauge) external view override returns (bool) { return _isGaugeFromFactory[gauge]; } /** * @dev Deploys a new gauge as a proxy of the implementation in storage. * The deployed gauge must be initialized by the caller method. * @return The address of the deployed gauge */ function _create() internal returns (address) { address gauge = Clones.clone(_gaugeImplementation); _isGaugeFromFactory[gauge] = true; emit GaugeCreated(gauge); return gauge; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/Clones.sol) pragma solidity ^0.7.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { // solhint-disable no-inline-assembly /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create(0, ptr, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create2(0, ptr, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) mstore(add(ptr, 0x38), shl(0x60, deployer)) mstore(add(ptr, 0x4c), salt) mstore(add(ptr, 0x6c), keccak256(ptr, 0x37)) predicted := keccak256(add(ptr, 0x37), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.7.0 <0.9.0; import "./IVersion.sol"; import "./ILiquidityGaugeFactory.sol"; // For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case // naming convention. // solhint-disable func-name-mixedcase // solhint-disable func-param-name-mixedcase interface IChildChainGauge is IVersion { /** * @notice Proxy constructor. * @param lpToken Pool allowed to stake in this gauge. * @param version Gauge version string identifier. */ function initialize(address lpToken, string memory version) external; /** * @notice Returns BAL liquidity emissions calculated during checkpoints for the given user. * @param user User address. * @return uint256 BAL amount to issue for the address. */ function integrate_fraction(address user) external view returns (uint256); /** * @notice Records a checkpoint for a given user. * @param user User address. * @return bool Always true. */ function user_checkpoint(address user) external returns (bool); /** * @notice Returns gauge factory address. */ function factory() external view returns (ILiquidityGaugeFactory); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.7.0 <0.9.0; // For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case // naming convention. // solhint-disable func-name-mixedcase // solhint-disable func-param-name-mixedcase interface ILiquidityGauge { // solhint-disable-next-line var-name-mixedcase event RelativeWeightCapChanged(uint256 new_relative_weight_cap); /** * @notice Returns BAL liquidity emissions calculated during checkpoints for the given user. * @param user User address. * @return uint256 BAL amount to issue for the address. */ function integrate_fraction(address user) external view returns (uint256); /** * @notice Record a checkpoint for a given user. * @param user User address. * @return bool Always true. */ function user_checkpoint(address user) external returns (bool); /** * @notice Returns true if gauge is killed; false otherwise. */ function is_killed() external view returns (bool); /** * @notice Kills the gauge so it cannot mint BAL. */ function killGauge() external; /** * @notice Unkills the gauge so it can mint BAL again. */ function unkillGauge() external; /** * @notice Sets a new relative weight cap for the gauge. * The value shall be normalized to 1e18, and not greater than MAX_RELATIVE_WEIGHT_CAP. * @param relativeWeightCap New relative weight cap. */ function setRelativeWeightCap(uint256 relativeWeightCap) external; /** * @notice Gets the relative weight cap for the gauge. */ function getRelativeWeightCap() external view returns (uint256); /** * @notice Returns the gauge's relative weight for a given time, capped to its relative weight cap attribute. * @param time Timestamp in the past or present. */ function getCappedRelativeWeight(uint256 time) external view returns (uint256); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; import "./ILiquidityGauge.sol"; interface ILiquidityGaugeFactory { /** * @notice Returns true if `gauge` was created by this factory. */ function isGaugeFromFactory(address gauge) external view returns (bool); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.7.0 <0.9.0; /** * @notice Simple interface to retrieve the version of a deployed contract. */ interface IVersion { /** * @dev Returns a JSON representation of the contract version containing name, version number and task ID. */ function version() external view returns (string memory); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.7.0; import "./interfaces/IVersion.sol"; /** * @notice Retrieves a contract's version set at creation time from storage. */ contract Version is IVersion { string private _version; constructor(string memory version) { _setVersion(version); } function version() external view override returns (string memory) { return _version; } /** * @dev Internal setter that allows this contract to be used in proxies. */ function _setVersion(string memory newVersion) internal { _version = newVersion; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IChildChainGauge","name":"gaugeImplementation","type":"address"},{"internalType":"string","name":"factoryVersion","type":"string"},{"internalType":"string","name":"productVersion","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gauge","type":"address"}],"name":"GaugeCreated","type":"event"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getGaugeImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProductVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"gauge","type":"address"}],"name":"isGaugeFromFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161084e38038061084e83398101604081905261002f91610284565b828261003a8161015f565b50600180546001600160a01b0319166001600160a01b039290921691909117905560405161006c90829060200161033c565b60405160208183030381529060405280519060200120836001600160a01b03166354fd4d506040518163ffffffff1660e01b815260040160006040518083038186803b1580156100bb57600080fd5b505afa1580156100cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526100f79190810190610302565b604051602001610107919061033c565b60405160208183030381529060405280519060200120146101435760405162461bcd60e51b815260040161013a90610358565b60405180910390fd5b8051610156906003906020840190610176565b505050506103b2565b8051610172906000906020840190610176565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101b757805160ff19168380011785556101e4565b828001600101855582156101e4579182015b828111156101e45782518255916020019190600101906101c9565b506101f09291506101f4565b5090565b5b808211156101f057600081556001016101f5565b600082601f830112610219578081fd5b81516001600160401b038082111561022f578283fd5b604051601f8301601f19168101602001828111828210171561024f578485fd5b60405282815292508284830160200186101561026a57600080fd5b61027b836020830160208801610382565b50505092915050565b600080600060608486031215610298578283fd5b83516001600160a01b03811681146102ae578384fd5b60208501519093506001600160401b03808211156102ca578384fd5b6102d687838801610209565b935060408601519150808211156102eb578283fd5b506102f886828701610209565b9150509250925092565b600060208284031215610313578081fd5b81516001600160401b03811115610328578182fd5b61033484828501610209565b949350505050565b6000825161034e818460208701610382565b9190910192915050565b60208082526010908201526f0ac8aa4a6929e9cbe9a92a69a82a886960831b604082015260600190565b60005b8381101561039d578181015183820152602001610385565b838111156103ac576000848401525b50505050565b61048d806103c16000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806318d6186f1461005c57806339312dee1461007a57806354fd4d501461008f5780639ed9331814610097578063ce3cc8bd146100aa575b600080fd5b6100646100ca565b6040516100719190610414565b60405180910390f35b610082610160565b60405161007191906103c9565b61006461016f565b6100826100a5366004610350565b6101d0565b6100bd6100b8366004610350565b61024d565b6040516100719190610409565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156101565780601f1061012b57610100808354040283529160200191610156565b820191906000526020600020905b81548152906001019060200180831161013957829003601f168201915b5050505050905090565b6001546001600160a01b031690565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156101565780601f1061012b57610100808354040283529160200191610156565b6000806101db61026b565b9050806001600160a01b031663f399e22e846101f56100ca565b6040518363ffffffff1660e01b81526004016102129291906103dd565b600060405180830381600087803b15801561022c57600080fd5b505af1158015610240573d6000803e3d6000fd5b509293505050505b919050565b6001600160a01b031660009081526002602052604090205460ff1690565b6001546000908190610285906001600160a01b03166102d8565b6001600160a01b038116600081815260026020526040808220805460ff191660011790555192935090917faa98436d09d130af48de49867af8b723bbbebb0d737638b5fe8f1bf31bbb71c09190a2905090565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b0381166102485760405162461bcd60e51b815260040161034790610427565b60405180910390fd5b600060208284031215610361578081fd5b81356001600160a01b0381168114610377578182fd5b9392505050565b60008151808452815b818110156103a357602081850181015186830182015201610387565b818111156103b45782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03831681526040602082018190526000906104019083018461037e565b949350505050565b901515815260200190565b600060208252610377602083018461037e565b602080825260169082015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b60408201526060019056fea26469706673582212204498b1faa438ccc72c2dc9400e4bce91960416b239aeb208c38fb546150c3b9664736f6c63430007000033000000000000000000000000f00c004d5453bbd71c2267b015516b80add7ce76000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000842454554532d5632000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000842454554532d5632000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806318d6186f1461005c57806339312dee1461007a57806354fd4d501461008f5780639ed9331814610097578063ce3cc8bd146100aa575b600080fd5b6100646100ca565b6040516100719190610414565b60405180910390f35b610082610160565b60405161007191906103c9565b61006461016f565b6100826100a5366004610350565b6101d0565b6100bd6100b8366004610350565b61024d565b6040516100719190610409565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156101565780601f1061012b57610100808354040283529160200191610156565b820191906000526020600020905b81548152906001019060200180831161013957829003601f168201915b5050505050905090565b6001546001600160a01b031690565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156101565780601f1061012b57610100808354040283529160200191610156565b6000806101db61026b565b9050806001600160a01b031663f399e22e846101f56100ca565b6040518363ffffffff1660e01b81526004016102129291906103dd565b600060405180830381600087803b15801561022c57600080fd5b505af1158015610240573d6000803e3d6000fd5b509293505050505b919050565b6001600160a01b031660009081526002602052604090205460ff1690565b6001546000908190610285906001600160a01b03166102d8565b6001600160a01b038116600081815260026020526040808220805460ff191660011790555192935090917faa98436d09d130af48de49867af8b723bbbebb0d737638b5fe8f1bf31bbb71c09190a2905090565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b0381166102485760405162461bcd60e51b815260040161034790610427565b60405180910390fd5b600060208284031215610361578081fd5b81356001600160a01b0381168114610377578182fd5b9392505050565b60008151808452815b818110156103a357602081850181015186830182015201610387565b818111156103b45782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03831681526040602082018190526000906104019083018461037e565b949350505050565b901515815260200190565b600060208252610377602083018461037e565b602080825260169082015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b60408201526060019056fea26469706673582212204498b1faa438ccc72c2dc9400e4bce91960416b239aeb208c38fb546150c3b9664736f6c63430007000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f00c004d5453bbd71c2267b015516b80add7ce76000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000842454554532d5632000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000842454554532d5632000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : gaugeImplementation (address): 0xF00c004d5453BBd71C2267b015516b80Add7Ce76
Arg [1] : factoryVersion (string): BEETS-V2
Arg [2] : productVersion (string): BEETS-V2
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000f00c004d5453bbd71c2267b015516b80add7ce76
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [4] : 42454554532d5632000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [6] : 42454554532d5632000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.