Source Code
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
There are no matching entriesUpdate your filters to view other transactions | |||||||||
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
TemplateV1
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.19;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./BaseTemplate.sol";
/**
* @author 0xMotoko
* @title TemplateV1
* @notice Minimal Proxy Platform-ish fork of the HegicInitialOffering.sol
*/
contract TemplateV1 is BaseTemplate, ReentrancyGuard {
using SafeERC20 for IERC20;
uint256 private constant TOKEN_UPPER_BOUND = 1e50;
uint256 private constant TOKEN_BOTTOM_BOUND = 1e6;
uint256 private constant ETH_UPPER_BOUND = 1_000_000_000 ether;
/* Multiplier derived from the practical max number of digits for eth (18 + 8) + 1 to avoid rounding error. */
uint256 private constant SCALE_FACTOR = 1e27;
/* Minimum bidding amount is set to minimize the possibility of refunds. */
uint256 private constant MIN_BID_AMOUNT = 0.001 ether;
/// Fixed rate for calculate the reward score
uint256 private constant REWARD_SCORE_RATE = 100;
IERC20 public erc20onsale;
uint256 public allocatedAmount;
uint256 public minRaisedAmount;
uint256 public totalRaised;
mapping(address => uint256) public raised;
constructor(
address factory_,
address feePool_,
address distributor_
) BaseTemplate(factory_, feePool_, distributor_) {}
/// @notice Initialize an auction
/// @dev Expected to be called by the factory's deployAuction function
/// @param owner_ Auction owner
/// @param startingAt_ Timestamp when the auction starts
/// @param eventDuration_ The duration of the auction in seconds
/// @param token_ The token address to be auctioned
/// @param allocatedAmount_ The amount of tokens to be auctioned
/// @param minRaisedAmount_ The minimum amount of tokens to be raised for the auction to be regarded as a success
function initialize(
address owner_,
uint256 startingAt_,
uint256 eventDuration_,
address token_,
uint256 allocatedAmount_,
uint256 minRaisedAmount_
) external payable onlyFactory returns (address, uint256) {
require(!initialized, "This contract has already been initialized");
initialized = true;
require(
msg.value == 0,
"This contract does not accept the creation fee"
);
require(owner_ != address(0), "owner must be there");
require(token_ != address(0), "Go with non null address.");
require(
allocatedAmount_ >= TOKEN_BOTTOM_BOUND,
"allocatedAmount must be greater than or equal to 1e6."
);
require(
allocatedAmount_ <= TOKEN_UPPER_BOUND,
"allocatedAmount must be less than or equal to 1e50."
);
require(
block.timestamp <= startingAt_,
"startingAt must be in the future"
);
require(eventDuration_ >= 1 days, "event duration is too short");
require(eventDuration_ <= 30 days, "event duration is too long");
require(
minRaisedAmount_ <= ETH_UPPER_BOUND,
"minRaisedAmount must be less than or equal to 1e27."
);
owner = owner_;
startingAt = startingAt_;
closingAt = startingAt_ + eventDuration_;
erc20onsale = IERC20(token_);
allocatedAmount = allocatedAmount_;
minRaisedAmount = minRaisedAmount_;
emit Deployed(
address(this),
owner_,
startingAt_,
closingAt,
token_,
abi.encodePacked(address(0)),
abi.encode(allocatedAmount_, minRaisedAmount_)
);
return (token_, allocatedAmount_);
}
receive() external payable {
require(
startingAt <= block.timestamp,
"The offering has not started yet"
);
require(block.timestamp <= closingAt, "The offering has already ended");
require(
msg.value >= MIN_BID_AMOUNT,
"The amount must be greater than or equal to 0.001ETH"
);
uint256 newTotalRaised = totalRaised + msg.value;
require(
newTotalRaised < SCALE_FACTOR,
"totalRaised is unexpectedly high"
);
totalRaised = newTotalRaised;
raised[msg.sender] += msg.value;
emit Raised(msg.sender, address(0), msg.value);
}
/// @notice Claim allocated tokens
/// @param participant The address of the user who contributed
/// @param recipient The address of the user who received the token allocation
function claim(
address participant,
address recipient
) external nonReentrant {
require(
block.timestamp > closingAt,
"Early to claim. Sale is not finished."
);
uint256 raisedAmount = raised[participant];
require(raisedAmount > 0, "You don't have any contribution.");
raised[participant] = 0;
uint256 erc20allocation = _calculateAllocation(
raisedAmount,
totalRaised,
allocatedAmount
);
if (totalRaised >= minRaisedAmount && erc20allocation != 0) {
if (msg.sender != participant && participant != recipient) {
revert("participant or recipient invalid");
}
erc20onsale.safeTransfer(recipient, erc20allocation);
IDistributor(distributor).addScore(
participant,
raisedAmount * REWARD_SCORE_RATE
);
emit Claimed(participant, recipient, raisedAmount, erc20allocation);
} else {
/* Refund process */
(bool success, ) = payable(participant).call{value: raisedAmount}(
""
);
require(success, "transfer failed");
emit Claimed(participant, recipient, raisedAmount, 0);
}
}
/// @param us usershare
/// @param tr totalraised
/// @param aa allocatedamount
/// @return al allocation
function _calculateAllocation(
uint256 us,
uint256 tr,
uint256 aa
) internal pure returns (uint256 al) {
al = (((us * SCALE_FACTOR) / tr) * aa) / SCALE_FACTOR;
}
/// @notice Send raised Ether to the owner
/// @dev The auction is finished, and enough Ether has been raised. The owner withdraws Ether, and contributors claim and receive their ERC-20 tokens.
function withdrawRaisedETH() external nonReentrant {
require(closingAt < block.timestamp, "Withdrawal unavailable yet.");
require(
totalRaised >= minRaisedAmount,
"The required amount has not been raised!"
);
if (closingAt + 3 days >= block.timestamp) {
uint256 minAllocation = _calculateAllocation(
MIN_BID_AMOUNT,
totalRaised,
allocatedAmount
);
require(
minAllocation > 0,
"Refund candidates may exist. Withdrawal unavailable yet."
);
}
uint256 gross = address(this).balance;
uint256 fee = (gross) / 100;
(bool feeSuccess, ) = payable(feePool).call{value: fee}("");
require(feeSuccess, "Fee transfer failed");
IDistributor(distributor).addScore(owner, gross * REWARD_SCORE_RATE);
(bool success, ) = payable(owner).call{value: address(this).balance}(
""
);
require(success, "Withdraw failed");
}
/// @notice Send auction tokens back to the owner
/// @dev The auction is finished, but the amount raised is not enough (Failed sale). The owner withdraws tokens, and contributors can get refunded.
function withdrawERC20Onsale() external {
require(closingAt < block.timestamp, "The offering must be completed");
require(
totalRaised < minRaisedAmount || totalRaised == 0,
"The required amount has been raised!"
);
erc20onsale.safeTransfer(owner, allocatedAmount);
}
/// @notice Send tokens to the specified address
/// @dev Expected to be used for funding the auction contract, to be delegate-called by the factory's deployAuction function
/// @param token_ Auction token address
/// @param amount_ Auction token amount
/// @param to_ Receiver
function initializeTransfer(
address token_,
uint256 amount_,
address to_
) external onlyDelegateFactory {
IERC20(token_).safeTransferFrom(msg.sender, to_, amount_);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated 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: GPL-3.0-or-later
pragma solidity 0.8.19;
import "./interfaces/IDistributor.sol";
/// @title BaseTemplate
/// @author DeFiGeek Community Japan
/// @notice Base template for each auction template
/// @dev Extend this contract for each auction template
contract BaseTemplate {
/// Flags that manage instance initialization
bool initialized;
address immutable feePool;
address immutable factory;
address immutable distributor;
address public owner;
uint256 public startingAt;
uint256 public closingAt;
/// @notice Record deployed parameters
/// @dev Use primitives for important information, bytes type compression for other information.
/// @param deployedAddress Deployed address of an auction
/// @param owner The address of auction owner
/// @param startingAt The timestamp when the auction starts
/// @param closingAt The timestamp when the auction ends
/// @param auctionToken The address of the token being auctioned
/// @param raisedTokens Concatenated addresses of the raised tokens
/// @param args Concatenated template-specific parameters in bytes
event Deployed(
address deployedAddress,
address owner,
uint256 startingAt,
uint256 closingAt,
address auctionToken,
bytes raisedTokens,
bytes args
);
/// @notice Record claim parameters
/// @dev Emit this event to track claim information when participants claim
/// @param participant The address of the user who contributed
/// @param recipient The address of the user who received the token allocation
/// @param userShare The amount of the participant's contribution
/// @param allocation The amount of the participant's token allocation
event Claimed(
address indexed participant,
address indexed recipient,
uint256 userShare,
uint256 allocation
);
/// @notice Record raised parameters
/// @dev Emit this event when the auction receives funds from participants to track raised information
/// @param participant The address of the user who contributed
/// @param token The address of the raised token
/// @param amount The amount of the raised token
event Raised(address indexed participant, address token, uint256 amount);
constructor(address factory_, address feePool_, address distributor_) {
factory = factory_;
feePool = feePool_;
distributor = distributor_;
}
/// @dev Allow only owner of auction instance
modifier onlyOwner() {
require(msg.sender == owner, "You are not the owner.");
_;
}
/// @dev Allow only delegatecall from factory
modifier onlyDelegateFactory() {
require(address(this) == factory, "You are not the factory.");
_;
}
/// @dev Allow only call from factory
modifier onlyFactory() {
require(msg.sender == factory, "You are not the factory.");
_;
}
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.19;
interface IDistributor {
function addScore(address targetAddress, uint256 amount) external;
}{
"optimizer": {
"enabled": true,
"runs": 10000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"factory_","type":"address"},{"internalType":"address","name":"feePool_","type":"address"},{"internalType":"address","name":"distributor_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"participant","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"userShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocation","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"deployedAddress","type":"address"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"startingAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"closingAt","type":"uint256"},{"indexed":false,"internalType":"address","name":"auctionToken","type":"address"},{"indexed":false,"internalType":"bytes","name":"raisedTokens","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"args","type":"bytes"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"participant","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Raised","type":"event"},{"inputs":[],"name":"allocatedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"participant","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closingAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc20onsale","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint256","name":"startingAt_","type":"uint256"},{"internalType":"uint256","name":"eventDuration_","type":"uint256"},{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"allocatedAmount_","type":"uint256"},{"internalType":"uint256","name":"minRaisedAmount_","type":"uint256"}],"name":"initialize","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"to_","type":"address"}],"name":"initializeTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minRaisedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"raised","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startingAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRaised","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawERC20Onsale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawRaisedETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60e06040523480156200001157600080fd5b5060405162001d0438038062001d04833981016040819052620000349162000074565b6001600160a01b0392831660a0529082166080521660c0526001600355620000be565b80516001600160a01b03811681146200006f57600080fd5b919050565b6000806000606084860312156200008a57600080fd5b620000958462000057565b9250620000a56020850162000057565b9150620000b56040850162000057565b90509250925092565b60805160a05160c051611c08620000fc600039600081816106d5015261137601526000818161091301526109c2015260006112900152611c086000f3fe6080604052600436106100d65760003560e01c80638da5cb5b1161007f578063c5c4744c11610059578063c5c4744c14610448578063d2a31c901461045e578063dccd43151461048b578063fdc2c74d146104a157600080fd5b80638da5cb5b146103c6578063a6e00ca51461041d578063b86c0e1f1461043257600080fd5b806321c0b342116100b057806321c0b3421461034557806328fb0cfe146103675780637e7e9ca91461038757600080fd5b8063115425e4146102d95780631391fd601461030257806318dfe5cf1461032f57600080fd5b366102d4574260015411156101325760405162461bcd60e51b815260206004820181905260248201527f546865206f66666572696e6720686173206e6f7420737461727465642079657460448201526064015b60405180910390fd5b6002544211156101845760405162461bcd60e51b815260206004820152601e60248201527f546865206f66666572696e672068617320616c726561647920656e64656400006044820152606401610129565b66038d7ea4c680003410156102015760405162461bcd60e51b815260206004820152603460248201527f54686520616d6f756e74206d7573742062652067726561746572207468616e2060448201527f6f7220657175616c20746f20302e3030314554480000000000000000000000006064820152608401610129565b6000346007546102119190611929565b90506b033b2e3c9fd0803ce8000000811061026e5760405162461bcd60e51b815260206004820181905260248201527f746f74616c52616973656420697320756e65787065637465646c7920686967686044820152606401610129565b60078190553360009081526008602052604081208054349290610292908490611929565b9091555050604080516000815234602082015233917f5d071d5d77696f8867c9e019adc5efcfb6d17f38e3192132d491a137da359d59910160405180910390a2005b600080fd5b3480156102e557600080fd5b506102ef60055481565b6040519081526020015b60405180910390f35b34801561030e57600080fd5b506102ef61031d36600461196b565b60086020526000908152604090205481565b34801561033b57600080fd5b506102ef60065481565b34801561035157600080fd5b5061036561036036600461198d565b6104b6565b005b34801561037357600080fd5b506103656103823660046119c0565b6108fb565b61039a6103953660046119fc565b6109a7565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016102f9565b3480156103d257600080fd5b506000546103f890610100900473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102f9565b34801561042957600080fd5b50610365610ff5565b34801561043e57600080fd5b506102ef60025481565b34801561045457600080fd5b506102ef60075481565b34801561046a57600080fd5b506004546103f89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561049757600080fd5b506102ef60015481565b3480156104ad57600080fd5b50610365611100565b6104be6114f6565b60025442116105355760405162461bcd60e51b815260206004820152602560248201527f4561726c7920746f20636c61696d2e2053616c65206973206e6f742066696e6960448201527f736865642e0000000000000000000000000000000000000000000000000000006064820152608401610129565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260086020526040902054806105a85760405162461bcd60e51b815260206004820181905260248201527f596f7520646f6e2774206861766520616e7920636f6e747269627574696f6e2e6044820152606401610129565b73ffffffffffffffffffffffffffffffffffffffff831660009081526008602052604081208190556007546005546105e191849161154f565b9050600654600754101580156105f657508015155b156107e3573373ffffffffffffffffffffffffffffffffffffffff85161480159061064d57508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561069a5760405162461bcd60e51b815260206004820181905260248201527f7061727469636970616e74206f7220726563697069656e7420696e76616c69646044820152606401610129565b6004546106be9073ffffffffffffffffffffffffffffffffffffffff168483611590565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663d119db4c85610706606486611a54565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561077157600080fd5b505af1158015610785573d6000803e3d6000fd5b5050604080518581526020810185905273ffffffffffffffffffffffffffffffffffffffff8088169450881692507f2f6639d24651730c7bf57c95ddbf96d66d11477e4ec626876f92c22e5f365e68910160405180910390a36108eb565b60008473ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d806000811461083d576040519150601f19603f3d011682016040523d82523d6000602084013e610842565b606091505b50509050806108935760405162461bcd60e51b815260206004820152600f60248201527f7472616e73666572206661696c656400000000000000000000000000000000006044820152606401610129565b604080518481526000602082015273ffffffffffffffffffffffffffffffffffffffff80871692908816917f2f6639d24651730c7bf57c95ddbf96d66d11477e4ec626876f92c22e5f365e68910160405180910390a3505b50506108f76001600355565b5050565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146109805760405162461bcd60e51b815260206004820152601860248201527f596f7520617265206e6f742074686520666163746f72792e00000000000000006044820152606401610129565b6109a273ffffffffffffffffffffffffffffffffffffffff8416338385611664565b505050565b6000803373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610a2f5760405162461bcd60e51b815260206004820152601860248201527f596f7520617265206e6f742074686520666163746f72792e00000000000000006044820152606401610129565b60005460ff1615610aa85760405162461bcd60e51b815260206004820152602a60248201527f5468697320636f6e74726163742068617320616c7265616479206265656e206960448201527f6e697469616c697a6564000000000000000000000000000000000000000000006064820152608401610129565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790553415610b475760405162461bcd60e51b815260206004820152602e60248201527f5468697320636f6e747261637420646f6573206e6f742061636365707420746860448201527f65206372656174696f6e206665650000000000000000000000000000000000006064820152608401610129565b73ffffffffffffffffffffffffffffffffffffffff8816610baa5760405162461bcd60e51b815260206004820152601360248201527f6f776e6572206d757374206265207468657265000000000000000000000000006044820152606401610129565b73ffffffffffffffffffffffffffffffffffffffff8516610c0d5760405162461bcd60e51b815260206004820152601960248201527f476f2077697468206e6f6e206e756c6c20616464726573732e000000000000006044820152606401610129565b620f4240841015610c865760405162461bcd60e51b815260206004820152603560248201527f616c6c6f6361746564416d6f756e74206d75737420626520677265617465722060448201527f7468616e206f7220657175616c20746f203165362e00000000000000000000006064820152608401610129565b74446c3b15f9926687d2c40534fdb564000000000000841115610d115760405162461bcd60e51b815260206004820152603360248201527f616c6c6f6361746564416d6f756e74206d757374206265206c6573732074686160448201527f6e206f7220657175616c20746f20316535302e000000000000000000000000006064820152608401610129565b86421115610d615760405162461bcd60e51b815260206004820181905260248201527f7374617274696e674174206d75737420626520696e20746865206675747572656044820152606401610129565b62015180861015610db45760405162461bcd60e51b815260206004820152601b60248201527f6576656e74206475726174696f6e20697320746f6f2073686f727400000000006044820152606401610129565b62278d00861115610e075760405162461bcd60e51b815260206004820152601a60248201527f6576656e74206475726174696f6e20697320746f6f206c6f6e670000000000006044820152606401610129565b6b033b2e3c9fd0803ce8000000831115610e895760405162461bcd60e51b815260206004820152603360248201527f6d696e526169736564416d6f756e74206d757374206265206c6573732074686160448201527f6e206f7220657175616c20746f20316532372e000000000000000000000000006064820152608401610129565b600080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff8b16021790556001879055610edc8688611929565b6002819055600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff881617905560058590556006849055604051600060208201527f6941bafd33fd21cfca650065c154bba3f36b75ea861c243be4cfa41505906b7c9130918b918b918a90603401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252602083018d90529082018b905290606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610fdf97969594939291611ad9565b60405180910390a1509296919550909350505050565b42600254106110465760405162461bcd60e51b815260206004820152601e60248201527f546865206f66666572696e67206d75737420626520636f6d706c6574656400006044820152606401610129565b60065460075410806110585750600754155b6110c95760405162461bcd60e51b8152602060048201526024808201527f54686520726571756972656420616d6f756e7420686173206265656e2072616960448201527f73656421000000000000000000000000000000000000000000000000000000006064820152608401610129565b6000546005546004546110fe9273ffffffffffffffffffffffffffffffffffffffff9182169261010090910490911690611590565b565b6111086114f6565b42600254106111595760405162461bcd60e51b815260206004820152601b60248201527f5769746864726177616c20756e617661696c61626c65207965742e00000000006044820152606401610129565b60065460075410156111d35760405162461bcd60e51b815260206004820152602860248201527f54686520726571756972656420616d6f756e7420686173206e6f74206265656e60448201527f20726169736564210000000000000000000000000000000000000000000000006064820152608401610129565b426002546203f4806111e59190611929565b1061127c57600061120266038d7ea4c6800060075460055461154f565b90506000811161127a5760405162461bcd60e51b815260206004820152603860248201527f526566756e642063616e64696461746573206d61792065786973742e2057697460448201527f6864726177616c20756e617661696c61626c65207965742e00000000000000006064820152608401610129565b505b47600061128a606483611b46565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611306576040519150601f19603f3d011682016040523d82523d6000602084013e61130b565b606091505b505090508061135c5760405162461bcd60e51b815260206004820152601360248201527f466565207472616e73666572206661696c6564000000000000000000000000006044820152606401610129565b60005473ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081169163d119db4c91610100909104166113b0606487611a54565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561141b57600080fd5b505af115801561142f573d6000803e3d6000fd5b505060008054604051919350610100900473ffffffffffffffffffffffffffffffffffffffff16915047908381818185875af1925050503d8060008114611492576040519150601f19603f3d011682016040523d82523d6000602084013e611497565b606091505b50509050806114e85760405162461bcd60e51b815260206004820152600f60248201527f5769746864726177206661696c656400000000000000000000000000000000006044820152606401610129565b505050506110fe6001600355565b6002600354036115485760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610129565b6002600355565b60006b033b2e3c9fd0803ce8000000828461156a8388611a54565b6115749190611b46565b61157e9190611a54565b6115889190611b46565b949350505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526109a29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526116c8565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526116c29085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016115e2565b50505050565b600061172a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166117bd9092919063ffffffff16565b905080516000148061174b57508080602001905181019061174b9190611b81565b6109a25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610129565b60606115888484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516117f19190611ba3565b60006040518083038185875af1925050503d806000811461182e576040519150601f19603f3d011682016040523d82523d6000602084013e611833565b606091505b50915091506118448783838761184f565b979650505050505050565b606083156118cb5782516000036118c45773ffffffffffffffffffffffffffffffffffffffff85163b6118c45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610129565b5081611588565b61158883838151156118e05781518083602001fd5b8060405162461bcd60e51b81526004016101299190611bbf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561193c5761193c6118fa565b92915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461196657600080fd5b919050565b60006020828403121561197d57600080fd5b61198682611942565b9392505050565b600080604083850312156119a057600080fd5b6119a983611942565b91506119b760208401611942565b90509250929050565b6000806000606084860312156119d557600080fd5b6119de84611942565b9250602084013591506119f360408501611942565b90509250925092565b60008060008060008060c08789031215611a1557600080fd5b611a1e87611942565b95506020870135945060408701359350611a3a60608801611942565b92506080870135915060a087013590509295509295509295565b808202811582820484141761193c5761193c6118fa565b60005b83811015611a86578181015183820152602001611a6e565b50506000910152565b60008151808452611aa7816020860160208601611a6b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff808a168352808916602084015287604084015286606084015280861660808401525060e060a0830152611b2660e0830185611a8f565b82810360c0840152611b388185611a8f565b9a9950505050505050505050565b600082611b7c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215611b9357600080fd5b8151801515811461198657600080fd5b60008251611bb5818460208701611a6b565b9190910192915050565b6020815260006119866020830184611a8f56fea26469706673582212201309b2e49dcb74abcd5c6792a3411e5220218b48dcba410f9b831aa8b588916464736f6c634300081300330000000000000000000000003ee0952314739e2c4270f0ece989cf73f58912430000000000000000000000009823e00b87367bb7b461bd5ec22dc1eb0064c8690000000000000000000000003d095553fe2a3b138b31f9d47a26e2adf340c6a5
Deployed Bytecode
0x6080604052600436106100d65760003560e01c80638da5cb5b1161007f578063c5c4744c11610059578063c5c4744c14610448578063d2a31c901461045e578063dccd43151461048b578063fdc2c74d146104a157600080fd5b80638da5cb5b146103c6578063a6e00ca51461041d578063b86c0e1f1461043257600080fd5b806321c0b342116100b057806321c0b3421461034557806328fb0cfe146103675780637e7e9ca91461038757600080fd5b8063115425e4146102d95780631391fd601461030257806318dfe5cf1461032f57600080fd5b366102d4574260015411156101325760405162461bcd60e51b815260206004820181905260248201527f546865206f66666572696e6720686173206e6f7420737461727465642079657460448201526064015b60405180910390fd5b6002544211156101845760405162461bcd60e51b815260206004820152601e60248201527f546865206f66666572696e672068617320616c726561647920656e64656400006044820152606401610129565b66038d7ea4c680003410156102015760405162461bcd60e51b815260206004820152603460248201527f54686520616d6f756e74206d7573742062652067726561746572207468616e2060448201527f6f7220657175616c20746f20302e3030314554480000000000000000000000006064820152608401610129565b6000346007546102119190611929565b90506b033b2e3c9fd0803ce8000000811061026e5760405162461bcd60e51b815260206004820181905260248201527f746f74616c52616973656420697320756e65787065637465646c7920686967686044820152606401610129565b60078190553360009081526008602052604081208054349290610292908490611929565b9091555050604080516000815234602082015233917f5d071d5d77696f8867c9e019adc5efcfb6d17f38e3192132d491a137da359d59910160405180910390a2005b600080fd5b3480156102e557600080fd5b506102ef60055481565b6040519081526020015b60405180910390f35b34801561030e57600080fd5b506102ef61031d36600461196b565b60086020526000908152604090205481565b34801561033b57600080fd5b506102ef60065481565b34801561035157600080fd5b5061036561036036600461198d565b6104b6565b005b34801561037357600080fd5b506103656103823660046119c0565b6108fb565b61039a6103953660046119fc565b6109a7565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016102f9565b3480156103d257600080fd5b506000546103f890610100900473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102f9565b34801561042957600080fd5b50610365610ff5565b34801561043e57600080fd5b506102ef60025481565b34801561045457600080fd5b506102ef60075481565b34801561046a57600080fd5b506004546103f89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561049757600080fd5b506102ef60015481565b3480156104ad57600080fd5b50610365611100565b6104be6114f6565b60025442116105355760405162461bcd60e51b815260206004820152602560248201527f4561726c7920746f20636c61696d2e2053616c65206973206e6f742066696e6960448201527f736865642e0000000000000000000000000000000000000000000000000000006064820152608401610129565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260086020526040902054806105a85760405162461bcd60e51b815260206004820181905260248201527f596f7520646f6e2774206861766520616e7920636f6e747269627574696f6e2e6044820152606401610129565b73ffffffffffffffffffffffffffffffffffffffff831660009081526008602052604081208190556007546005546105e191849161154f565b9050600654600754101580156105f657508015155b156107e3573373ffffffffffffffffffffffffffffffffffffffff85161480159061064d57508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561069a5760405162461bcd60e51b815260206004820181905260248201527f7061727469636970616e74206f7220726563697069656e7420696e76616c69646044820152606401610129565b6004546106be9073ffffffffffffffffffffffffffffffffffffffff168483611590565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000003d095553fe2a3b138b31f9d47a26e2adf340c6a51663d119db4c85610706606486611a54565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561077157600080fd5b505af1158015610785573d6000803e3d6000fd5b5050604080518581526020810185905273ffffffffffffffffffffffffffffffffffffffff8088169450881692507f2f6639d24651730c7bf57c95ddbf96d66d11477e4ec626876f92c22e5f365e68910160405180910390a36108eb565b60008473ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d806000811461083d576040519150601f19603f3d011682016040523d82523d6000602084013e610842565b606091505b50509050806108935760405162461bcd60e51b815260206004820152600f60248201527f7472616e73666572206661696c656400000000000000000000000000000000006044820152606401610129565b604080518481526000602082015273ffffffffffffffffffffffffffffffffffffffff80871692908816917f2f6639d24651730c7bf57c95ddbf96d66d11477e4ec626876f92c22e5f365e68910160405180910390a3505b50506108f76001600355565b5050565b3073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000003ee0952314739e2c4270f0ece989cf73f589124316146109805760405162461bcd60e51b815260206004820152601860248201527f596f7520617265206e6f742074686520666163746f72792e00000000000000006044820152606401610129565b6109a273ffffffffffffffffffffffffffffffffffffffff8416338385611664565b505050565b6000803373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000003ee0952314739e2c4270f0ece989cf73f58912431614610a2f5760405162461bcd60e51b815260206004820152601860248201527f596f7520617265206e6f742074686520666163746f72792e00000000000000006044820152606401610129565b60005460ff1615610aa85760405162461bcd60e51b815260206004820152602a60248201527f5468697320636f6e74726163742068617320616c7265616479206265656e206960448201527f6e697469616c697a6564000000000000000000000000000000000000000000006064820152608401610129565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790553415610b475760405162461bcd60e51b815260206004820152602e60248201527f5468697320636f6e747261637420646f6573206e6f742061636365707420746860448201527f65206372656174696f6e206665650000000000000000000000000000000000006064820152608401610129565b73ffffffffffffffffffffffffffffffffffffffff8816610baa5760405162461bcd60e51b815260206004820152601360248201527f6f776e6572206d757374206265207468657265000000000000000000000000006044820152606401610129565b73ffffffffffffffffffffffffffffffffffffffff8516610c0d5760405162461bcd60e51b815260206004820152601960248201527f476f2077697468206e6f6e206e756c6c20616464726573732e000000000000006044820152606401610129565b620f4240841015610c865760405162461bcd60e51b815260206004820152603560248201527f616c6c6f6361746564416d6f756e74206d75737420626520677265617465722060448201527f7468616e206f7220657175616c20746f203165362e00000000000000000000006064820152608401610129565b74446c3b15f9926687d2c40534fdb564000000000000841115610d115760405162461bcd60e51b815260206004820152603360248201527f616c6c6f6361746564416d6f756e74206d757374206265206c6573732074686160448201527f6e206f7220657175616c20746f20316535302e000000000000000000000000006064820152608401610129565b86421115610d615760405162461bcd60e51b815260206004820181905260248201527f7374617274696e674174206d75737420626520696e20746865206675747572656044820152606401610129565b62015180861015610db45760405162461bcd60e51b815260206004820152601b60248201527f6576656e74206475726174696f6e20697320746f6f2073686f727400000000006044820152606401610129565b62278d00861115610e075760405162461bcd60e51b815260206004820152601a60248201527f6576656e74206475726174696f6e20697320746f6f206c6f6e670000000000006044820152606401610129565b6b033b2e3c9fd0803ce8000000831115610e895760405162461bcd60e51b815260206004820152603360248201527f6d696e526169736564416d6f756e74206d757374206265206c6573732074686160448201527f6e206f7220657175616c20746f20316532372e000000000000000000000000006064820152608401610129565b600080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff8b16021790556001879055610edc8688611929565b6002819055600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff881617905560058590556006849055604051600060208201527f6941bafd33fd21cfca650065c154bba3f36b75ea861c243be4cfa41505906b7c9130918b918b918a90603401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252602083018d90529082018b905290606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610fdf97969594939291611ad9565b60405180910390a1509296919550909350505050565b42600254106110465760405162461bcd60e51b815260206004820152601e60248201527f546865206f66666572696e67206d75737420626520636f6d706c6574656400006044820152606401610129565b60065460075410806110585750600754155b6110c95760405162461bcd60e51b8152602060048201526024808201527f54686520726571756972656420616d6f756e7420686173206265656e2072616960448201527f73656421000000000000000000000000000000000000000000000000000000006064820152608401610129565b6000546005546004546110fe9273ffffffffffffffffffffffffffffffffffffffff9182169261010090910490911690611590565b565b6111086114f6565b42600254106111595760405162461bcd60e51b815260206004820152601b60248201527f5769746864726177616c20756e617661696c61626c65207965742e00000000006044820152606401610129565b60065460075410156111d35760405162461bcd60e51b815260206004820152602860248201527f54686520726571756972656420616d6f756e7420686173206e6f74206265656e60448201527f20726169736564210000000000000000000000000000000000000000000000006064820152608401610129565b426002546203f4806111e59190611929565b1061127c57600061120266038d7ea4c6800060075460055461154f565b90506000811161127a5760405162461bcd60e51b815260206004820152603860248201527f526566756e642063616e64696461746573206d61792065786973742e2057697460448201527f6864726177616c20756e617661696c61626c65207965742e00000000000000006064820152608401610129565b505b47600061128a606483611b46565b905060007f0000000000000000000000009823e00b87367bb7b461bd5ec22dc1eb0064c86973ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611306576040519150601f19603f3d011682016040523d82523d6000602084013e61130b565b606091505b505090508061135c5760405162461bcd60e51b815260206004820152601360248201527f466565207472616e73666572206661696c6564000000000000000000000000006044820152606401610129565b60005473ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000003d095553fe2a3b138b31f9d47a26e2adf340c6a581169163d119db4c91610100909104166113b0606487611a54565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561141b57600080fd5b505af115801561142f573d6000803e3d6000fd5b505060008054604051919350610100900473ffffffffffffffffffffffffffffffffffffffff16915047908381818185875af1925050503d8060008114611492576040519150601f19603f3d011682016040523d82523d6000602084013e611497565b606091505b50509050806114e85760405162461bcd60e51b815260206004820152600f60248201527f5769746864726177206661696c656400000000000000000000000000000000006044820152606401610129565b505050506110fe6001600355565b6002600354036115485760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610129565b6002600355565b60006b033b2e3c9fd0803ce8000000828461156a8388611a54565b6115749190611b46565b61157e9190611a54565b6115889190611b46565b949350505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526109a29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526116c8565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526116c29085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016115e2565b50505050565b600061172a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166117bd9092919063ffffffff16565b905080516000148061174b57508080602001905181019061174b9190611b81565b6109a25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610129565b60606115888484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516117f19190611ba3565b60006040518083038185875af1925050503d806000811461182e576040519150601f19603f3d011682016040523d82523d6000602084013e611833565b606091505b50915091506118448783838761184f565b979650505050505050565b606083156118cb5782516000036118c45773ffffffffffffffffffffffffffffffffffffffff85163b6118c45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610129565b5081611588565b61158883838151156118e05781518083602001fd5b8060405162461bcd60e51b81526004016101299190611bbf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561193c5761193c6118fa565b92915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461196657600080fd5b919050565b60006020828403121561197d57600080fd5b61198682611942565b9392505050565b600080604083850312156119a057600080fd5b6119a983611942565b91506119b760208401611942565b90509250929050565b6000806000606084860312156119d557600080fd5b6119de84611942565b9250602084013591506119f360408501611942565b90509250925092565b60008060008060008060c08789031215611a1557600080fd5b611a1e87611942565b95506020870135945060408701359350611a3a60608801611942565b92506080870135915060a087013590509295509295509295565b808202811582820484141761193c5761193c6118fa565b60005b83811015611a86578181015183820152602001611a6e565b50506000910152565b60008151808452611aa7816020860160208601611a6b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff808a168352808916602084015287604084015286606084015280861660808401525060e060a0830152611b2660e0830185611a8f565b82810360c0840152611b388185611a8f565b9a9950505050505050505050565b600082611b7c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215611b9357600080fd5b8151801515811461198657600080fd5b60008251611bb5818460208701611a6b565b9190910192915050565b6020815260006119866020830184611a8f56fea26469706673582212201309b2e49dcb74abcd5c6792a3411e5220218b48dcba410f9b831aa8b588916464736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003ee0952314739e2c4270f0ece989cf73f58912430000000000000000000000009823e00b87367bb7b461bd5ec22dc1eb0064c8690000000000000000000000003d095553fe2a3b138b31f9d47a26e2adf340c6a5
-----Decoded View---------------
Arg [0] : factory_ (address): 0x3Ee0952314739e2c4270F0ecE989cf73F5891243
Arg [1] : feePool_ (address): 0x9823E00b87367bB7B461Bd5eC22Dc1eB0064c869
Arg [2] : distributor_ (address): 0x3D095553fE2A3b138B31f9d47a26e2aDf340c6a5
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000003ee0952314739e2c4270f0ece989cf73f5891243
Arg [1] : 0000000000000000000000009823e00b87367bb7b461bd5ec22dc1eb0064c869
Arg [2] : 0000000000000000000000003d095553fe2a3b138b31f9d47a26e2adf340c6a5
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.