Source Code
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
IndexPool
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.28;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Ownable2Step, Ownable} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {IERC20Burnable} from "./interfaces/IERC20Burnable.sol";
import {IIndexPool} from "./interfaces/IIndexPool.sol";
/**
* @title BadAI Index Pool.
* @notice The index pool holds tokens launched on the BadAILaunchpad and releases them for burning the AIKING index pool token.
*/
contract IndexPool is IIndexPool, Ownable2Step, ReentrancyGuard {
using SafeERC20 for IERC20;
IERC20Burnable public immutable indexToken;
address[] public heldTokens;
event IndexTokenBurned(address indexed userAddress, uint amount);
event TokenAdded();
error InvalidIndexTokenAddress();
error SkipArrayNotInSameOrderAsHeldTokensArray();
error TokenCanNotBeAddedTwice();
constructor(address _indexToken) Ownable(msg.sender) {
// Sanitize address input
if (_indexToken == address(0)) {
revert InvalidIndexTokenAddress();
}
indexToken = IERC20Burnable(_indexToken);
}
/**
* @notice Burns the index token and distributes the underlying tokens to the caller.
* @param _amount The amount of index tokens to burn.
*/
function burnIndexToken(uint256 _amount) external {
// Distribute all indexed tokens by default
address[] memory emptyArray = new address[](0);
burnIndexTokenAndSkipSomeTokens(_amount, emptyArray);
}
/**
* @notice Burns the index token and distributes the underlying tokens to the caller, skipping potentially broken or unwanted tokens.
* @dev This skipping feature of this function is a security consideration to prevent bugged tokens in the pool from bricking the whole pool. This option was chosen over removing tokens from the pool because it is in the user's control and can not be abused by the owner.
* @param _amount The amount of index tokens to burn.
* @param _skipTokens The addresses of the tokens to skip. They need to be in the same order as the heldTokens array so that the function can skip them efficiently.
*/
function burnIndexTokenAndSkipSomeTokens(
uint256 _amount,
address[] memory _skipTokens
) public nonReentrant {
uint256 totalSupplyBefore = indexToken.totalSupply();
// burn the index token directly after snapshotting the total supply as additional reentrance protection
indexToken.burnFrom(msg.sender, _amount);
uint256 amountOfPoolBalance;
uint256 skipIndex = 0;
for (uint256 i = 0; i < heldTokens.length; i++) {
// Skip tokens that are in the skipTokens array.
// Because we require the skipTokens array to be in the same order as the heldTokens array, it suffices to check the next element only.
if (
skipIndex < _skipTokens.length &&
heldTokens[i] == _skipTokens[skipIndex]
) {
skipIndex++;
continue;
}
amountOfPoolBalance =
(IERC20(heldTokens[i]).balanceOf(address(this)) * _amount) /
totalSupplyBefore;
if (amountOfPoolBalance > 0) {
IERC20(heldTokens[i]).safeTransfer(
msg.sender,
amountOfPoolBalance
);
}
}
// If we have not skipped all tokens to be skipped, it means the skip array is not in the same order as the heldTokens array
if (skipIndex < _skipTokens.length) {
revert SkipArrayNotInSameOrderAsHeldTokensArray();
}
emit IndexTokenBurned(msg.sender, _amount);
}
/**
* @dev Internal function to add a token to the index pool. Make sure the public facing function checks the onlyOwner modifier. It saves gas because onlyOwner is only checked once.
* @param _tokenAddress The address of the token to add.
*/
function _addToken(address _tokenAddress) internal {
// Check if the token is already in the pool, to prevent distributing it multiple times
for (uint256 i = 0; i < heldTokens.length; i++) {
if (heldTokens[i] == _tokenAddress) {
revert TokenCanNotBeAddedTwice();
}
}
heldTokens.push(_tokenAddress);
emit TokenAdded();
}
/**
* @notice Adds a token to the index pool.
* @param _tokenAddress The address of the token to add.
*/
function addToken(address _tokenAddress) public onlyOwner {
_addToken(_tokenAddress);
}
/**
* @notice Adds a batch of tokens to the index pool.
* @param _tokens The addresses of the tokens to add.
*/
function addTokenBatch(address[] calldata _tokens) external onlyOwner {
for (uint256 i = 0; i < _tokens.length; i++) {
_addToken(_tokens[i]);
}
}
function getHeldTokens() external view returns (address[] memory) {
return heldTokens;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {Ownable} from "./Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This extension of the {Ownable} contract includes a two-step mechanism to transfer
* ownership, where the new owner must call {acceptOwnership} in order to replace the
* old one. This can help prevent common mistakes, such as transfers of ownership to
* incorrect accounts, or to contracts that are unable to interact with the
* permission system.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*
* Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 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 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert Errors.FailedCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {Errors.FailedCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
* of an unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {Errors.FailedCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.FailedCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @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 EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* 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;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
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
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// 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
pragma solidity ^0.8.28;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Burnable is IERC20 {
function burn(uint256 amount) external;
function burnFrom(address account, uint256 amount) external;
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.28;
import {IERC20Burnable} from "./IERC20Burnable.sol";
/**
* @title Interface for the BadAI Index Pool.
* @notice Interface for the index pool that holds tokens launched on the BadAILaunchpad.
*/
interface IIndexPool {
/**
* @notice Burns the index token and distributes the underlying tokens to the caller.
* @param _amount The amount of index tokens to burn.
*/
function burnIndexToken(uint256 _amount) external;
/**
* @notice Burns the index token and distributes the underlying tokens to the caller, skipping potentially broken or unwanted tokens.
* @param _amount The amount of index tokens to burn.
* @param _skipTokens The addresses of the tokens to skip.
*/
function burnIndexTokenAndSkipSomeTokens(
uint256 _amount,
address[] memory _skipTokens
) external;
/**
* @notice Returns the list of tokens held in the index pool.
* @return An array of token addresses held in the pool.
*/
function getHeldTokens() external view returns (address[] memory);
/**
* @notice Returns the address of the index token.
* @return The address of the index token.
*/
function indexToken() external view returns (IERC20Burnable);
/**
* @notice Adds a token to the index pool.
* @param _token The address of the token to add.
*/
function addToken(address _token) external;
/**
* @notice Adds multiple tokens to the index pool.
* @param _tokens An array of token addresses to add.
*/
function addTokenBatch(address[] memory _tokens) external;
}{
"viaIR": true,
"optimizer": {
"enabled": true,
"runs": 200,
"details": {
"yulDetails": {
"optimizerSteps": "u"
}
}
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_indexToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidIndexTokenAddress","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SkipArrayNotInSameOrderAsHeldTokensArray","type":"error"},{"inputs":[],"name":"TokenCanNotBeAddedTwice","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"IndexTokenBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[],"name":"TokenAdded","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"addToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"}],"name":"addTokenBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burnIndexToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address[]","name":"_skipTokens","type":"address[]"}],"name":"burnIndexTokenAndSkipSomeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getHeldTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"heldTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"indexToken","outputs":[{"internalType":"contract IERC20Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523461003a576100196100146100d2565b61012c565b604051610f6661031a823960805181818161052d01526107e60152610f6690f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b0382111761007657604052565b61003f565b9061008f61008860405190565b9283610055565b565b6001600160a01b031690565b90565b6001600160a01b0381160361003a57565b9050519061008f826100a0565b9060208282031261003a5761009d916100b1565b61009d611280803803806100e58161007b565b9283398101906100be565b61009161009d61009d9290565b61009d906100f0565b61009d90610091906001600160a01b031682565b61009d90610106565b61009d9061011a565b610135336101b7565b6000610143610091826100fd565b6001600160a01b03831614610161575061015c90610123565b608052565b6351a2542560e01b815280600481015b0390fd5b61009d61009d61009d9290565b61009d6001610175565b90600019905b9181191691161790565b906101ac61009d6101b392610175565b825461018c565b9055565b6101c0906101d2565b61008f6101cb610182565b600261019c565b61008f906101ee565b6001600160a01b03909116815260200190565b60006101f9816100fd565b6001600160a01b0381166001600160a01b0384161461021d57505061008f90610274565b631e4fbdf760e01b8252819061017190600483016101db565b916001600160a01b0360089290920291821b911b610192565b919061026061009d6101b393610123565b908354610236565b61008f9160009161024f565b61008f9061028460006001610268565b6102c2565b61009d90610091565b61009d9054610289565b906001600160a01b0390610192565b906102bb61009d6101b392610123565b825461029c565b6102e86102e26102d26000610292565b6102dd8460006102ab565b610123565b91610123565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e061031360405190565b600090a356fe6080604052600436101561001257600080fd5b60003560e01c80630aa801e2146100d25780633a590c06146100cd5780635fb2f8bf146100c8578063640713e8146100c3578063715018a6146100be57806379ba5097146100b95780638da5cb5b146100b4578063b6f9ab4b146100af578063d48bfca7146100aa578063e30c3978146100a5578063e7d015f2146100a05763f2fde38b036100e057610552565b610514565b6104ba565b6104a2565b610473565b6103c3565b6103ab565b610393565b61037a565b610239565b6101b8565b61010b565b805b036100e057565b600080fd5b905035906100f2826100d7565b565b906020828203126100e057610108916100e5565b90565b346100e05761012361011e3660046100f4565b6105b1565b60405180805b0390f35b60009103126100e057565b6001600160a01b031690565b9052565b90610168610161610157845190565b8084529260200190565b9260200190565b9060005b8181106101795750505090565b90919261019f61019860019286516001600160a01b0316815260200190565b9460200190565b92910161016c565b602080825261010892910190610148565b346100e0576101c836600461012d565b6101296101d361066f565b604051918291826101a7565b909182601f830112156100e05781359167ffffffffffffffff83116100e05760200192602083028401116100e057565b906020828203126100e057813567ffffffffffffffff81116100e05761023592016101df565b9091565b346100e05761012361024c36600461020f565b906106ea565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff82111761028a57604052565b610252565b906100f261029c60405190565b9283610268565b67ffffffffffffffff811161028a5760208091020190565b6001600160a01b0381166100d9565b905035906100f2826102bb565b909291926102ec6102e7826102a3565b61028f565b93818552602080860192028301928184116100e057915b8383106103105750505050565b6020809161031e84866102ca565b815201920191610303565b9080601f830112156100e057816020610108933591016102d7565b9190916040818403126100e05761035b83826100e5565b92602082013567ffffffffffffffff81116100e0576101089201610329565b346100e05761012361038d366004610344565b90610ab9565b346100e0576103a336600461012d565b610123610afb565b346100e0576103bb36600461012d565b610123610b03565b346100e0576103d336600461012d565b6101296103de610b4e565b604051918291826001600160a01b03909116815260200190565b634e487b7160e01b600052603260045260246000fd5b805482101561043157610428600191600052602060002090565b91020190600090565b6103f8565b610108916008021c6001600160a01b031690565b906101089154610436565b6003548110156100e05761046d61010891600361040e565b9061044a565b346100e0576101296103de6104893660046100f4565b610455565b906020828203126100e057610108916102ca565b346100e0576101236104b536600461048e565b610b6d565b346100e0576104ca36600461012d565b6101296103de610b76565b61010890610138906001600160a01b031682565b610108906104d5565b610108906104e9565b610144906104f2565b6020810192916100f291906104fb565b346100e05761052436600461012d565b604051806101297f000000000000000000000000000000000000000000000000000000000000000082610504565b346100e05761012361056536600461048e565b610c11565b6101086101086101089290565b906105846102e7836102a3565b918252565b369037565b906100f26105a461059e84610577565b936102a3565b601f190160208401610589565b6100f29061038d6105c2600061056a565b61058e565b61010890610138565b61010890546105c7565b906105f56105e9610157845490565b92600052602060002090565b9060005b8181106106065750505090565b90919261063361062c60019261061b876105d0565b6001600160a01b0316815260200190565b9460010190565b9291016105f9565b90610108916105da565b906100f261065f9261065660405190565b9384809261063b565b0383610268565b61010890610645565b6101086003610666565b906100f291610686610c1a565b6106a5565b9190811015610431576020020190565b35610108816102bb565b9190916106b2600061056a565b838110156106e457806106d96106d46106cf6106df94888761068b565b61069b565b610c95565b60010190565b6106b2565b50509050565b906100f291610679565b9061070691610701610d72565b6107df565b6100f2610db2565b905051906100f2826100d7565b906020828203126100e0576101089161070e565b6040513d6000823e3d90fd5b6001600160a01b0390911681526040810192916100f29160200152565b90610761825190565b811015610431576020809102010190565b634e487b7160e01b600052601160045260246000fd5b60001981146107975760010190565b610772565b8181029291811591840414171561079757565b634e487b7160e01b600052601260045260246000fd5b906107cf565b9190565b9081156107da570490565b6107af565b919061080a7f00000000000000000000000000000000000000000000000000000000000000006104f2565b9161081460405190565b6318160ddd60e01b815292602084600481845afa9384156109a657600094610a98575b50803b156100e057600061084a60405190565b91829063079cc67960e41b82528183816108688b336004840161073b565b03925af180156109a657610a7a575b506000906108848261056a565b94855b600390610895610108835490565b811015610a02576108a7610108875190565b8810806109c1575b6109ab5761090b60206108d06108cb6108cb61046d868861040e565b6104f2565b6108d9306104f2565b906108e360405190565b938492839182916370a0823160e01b8352600483016001600160a01b03909116815260200190565b03915afa9283156109a6576109378961093287610951978796600091610978575b5061079c565b6107c5565b906109418861056a565b8211610956575b50505060010190565b610887565b6108cb61046d610970946109699361040e565b3390610dea565b803880610948565b610999915060203d811161099f575b6109918183610268565b81019061071b565b3861092c565b503d610987565b61072f565b9661095191506109ba90610788565b9660010190565b506109cf61046d828461040e565b6109fc6109ef6101386109e28c8b610758565b516001600160a01b031690565b916001600160a01b031690565b146108af565b505093509390916107cb610108610a17925190565b10610a6657507f55dba97f0670d744dc3f944eff654b45a97ba6987fdd8e7b484b2ebea6085958610a61610a4a336104f2565b92610a5460405190565b9182918290815260200190565b0390a2565b63bfc2e04960e01b815280600481015b0390fd5b610a92906000610a8a8183610268565b81019061012d565b38610877565b610ab291945060203d60201161099f576109918183610268565b9238610837565b906100f2916106f4565b610acb610c1a565b6100f2610ae9565b6101386101086101089290565b61010890610ad3565b6100f2610af66000610ae0565b610e3e565b6100f2610ac3565b33610b0c610b76565b610b1e6001600160a01b0383166109ef565b03610b2c576100f290610e3e565b63118cdaa760e01b60009081526001600160a01b039091166004526024036000fd5b61010860006105d0565b6100f290610b64610c1a565b6100f290610c95565b6100f290610b58565b61010860016105d0565b6100f290610b8c610c1a565b610bc1565b906001600160a01b03905b9181191691161790565b90610bb6610108610bbd926104f2565b8254610b91565b9055565b610bcc816001610ba6565b610be0610bda6108cb610b4e565b916104f2565b907f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700610c0b60405190565b600090a3565b6100f290610b80565b610c22610b4e565b3390610c2d826109ef565b03610b2c5750565b916001600160a01b0360089290920291821b911b610b9c565b9190610c5f610108610bbd936104f2565b908354610c35565b908154916801000000000000000083101561028a5782610c8f9160016100f29501815561040e565b90610c4e565b90600091610ca28361056a565b6003610caf610108825490565b821015610cf15761046d82610cc39261040e565b610cd56001600160a01b0384166109ef565b14610ce257600101610ca2565b63c50eb08f60e01b8452600484fd5b5050610d06919250610d01600390565b610c67565b7f6e1292104a41acea39635a2d29bb547a5f01d5b629a46ca75ee96e836ebc481d610d3060405190565b600090a1565b6101089081565b6101089054610d36565b610108600261056a565b9060001990610b9c565b90610d6b610108610bbd9261056a565b8254610d51565b610d7c6002610d3d565b610d84610d47565b908114610d96576100f2906002610d5b565b633ee5aeb560e01b6000908152600490fd5b610108600161056a565b6100f2610dbd610da8565b6002610d5b565b610ddd610dd76101089263ffffffff1690565b60e01b90565b6001600160e01b03191690565b610e2d600492610e1e6100f295610e0463a9059cbb610dc4565b92610e0e60405190565b968794602086019081520161073b565b60208201810382520383610268565b610e53565b6100f291600091610c4e565b6100f290610e4e60006001610e32565b610eea565b906000602091610e61600090565b50828151910182855af11561072f573d90600051600092610e846107cb8561056a565b03610ed65750610e93816104f2565b3b610ea06107cb8461056a565b145b610eaa575050565b610a76610eb783926104f2565b635274afe760e01b83526001600160a01b031660048301526024820190565b610ee36107cb600161056a565b1415610ea2565b610f05610bda610efa60006105d0565b6108cb846000610ba6565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0610c0b6040519056fea2646970667358221220b8ac25f93474072d9a0702e0239a96daed41bba72cbac6243e0ca6ae35d0d94e64736f6c634300081c003300000000000000000000000078bce097dd647907e9a559c4cff7acb3742e57ae
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c80630aa801e2146100d25780633a590c06146100cd5780635fb2f8bf146100c8578063640713e8146100c3578063715018a6146100be57806379ba5097146100b95780638da5cb5b146100b4578063b6f9ab4b146100af578063d48bfca7146100aa578063e30c3978146100a5578063e7d015f2146100a05763f2fde38b036100e057610552565b610514565b6104ba565b6104a2565b610473565b6103c3565b6103ab565b610393565b61037a565b610239565b6101b8565b61010b565b805b036100e057565b600080fd5b905035906100f2826100d7565b565b906020828203126100e057610108916100e5565b90565b346100e05761012361011e3660046100f4565b6105b1565b60405180805b0390f35b60009103126100e057565b6001600160a01b031690565b9052565b90610168610161610157845190565b8084529260200190565b9260200190565b9060005b8181106101795750505090565b90919261019f61019860019286516001600160a01b0316815260200190565b9460200190565b92910161016c565b602080825261010892910190610148565b346100e0576101c836600461012d565b6101296101d361066f565b604051918291826101a7565b909182601f830112156100e05781359167ffffffffffffffff83116100e05760200192602083028401116100e057565b906020828203126100e057813567ffffffffffffffff81116100e05761023592016101df565b9091565b346100e05761012361024c36600461020f565b906106ea565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff82111761028a57604052565b610252565b906100f261029c60405190565b9283610268565b67ffffffffffffffff811161028a5760208091020190565b6001600160a01b0381166100d9565b905035906100f2826102bb565b909291926102ec6102e7826102a3565b61028f565b93818552602080860192028301928184116100e057915b8383106103105750505050565b6020809161031e84866102ca565b815201920191610303565b9080601f830112156100e057816020610108933591016102d7565b9190916040818403126100e05761035b83826100e5565b92602082013567ffffffffffffffff81116100e0576101089201610329565b346100e05761012361038d366004610344565b90610ab9565b346100e0576103a336600461012d565b610123610afb565b346100e0576103bb36600461012d565b610123610b03565b346100e0576103d336600461012d565b6101296103de610b4e565b604051918291826001600160a01b03909116815260200190565b634e487b7160e01b600052603260045260246000fd5b805482101561043157610428600191600052602060002090565b91020190600090565b6103f8565b610108916008021c6001600160a01b031690565b906101089154610436565b6003548110156100e05761046d61010891600361040e565b9061044a565b346100e0576101296103de6104893660046100f4565b610455565b906020828203126100e057610108916102ca565b346100e0576101236104b536600461048e565b610b6d565b346100e0576104ca36600461012d565b6101296103de610b76565b61010890610138906001600160a01b031682565b610108906104d5565b610108906104e9565b610144906104f2565b6020810192916100f291906104fb565b346100e05761052436600461012d565b604051806101297f00000000000000000000000078bce097dd647907e9a559c4cff7acb3742e57ae82610504565b346100e05761012361056536600461048e565b610c11565b6101086101086101089290565b906105846102e7836102a3565b918252565b369037565b906100f26105a461059e84610577565b936102a3565b601f190160208401610589565b6100f29061038d6105c2600061056a565b61058e565b61010890610138565b61010890546105c7565b906105f56105e9610157845490565b92600052602060002090565b9060005b8181106106065750505090565b90919261063361062c60019261061b876105d0565b6001600160a01b0316815260200190565b9460010190565b9291016105f9565b90610108916105da565b906100f261065f9261065660405190565b9384809261063b565b0383610268565b61010890610645565b6101086003610666565b906100f291610686610c1a565b6106a5565b9190811015610431576020020190565b35610108816102bb565b9190916106b2600061056a565b838110156106e457806106d96106d46106cf6106df94888761068b565b61069b565b610c95565b60010190565b6106b2565b50509050565b906100f291610679565b9061070691610701610d72565b6107df565b6100f2610db2565b905051906100f2826100d7565b906020828203126100e0576101089161070e565b6040513d6000823e3d90fd5b6001600160a01b0390911681526040810192916100f29160200152565b90610761825190565b811015610431576020809102010190565b634e487b7160e01b600052601160045260246000fd5b60001981146107975760010190565b610772565b8181029291811591840414171561079757565b634e487b7160e01b600052601260045260246000fd5b906107cf565b9190565b9081156107da570490565b6107af565b919061080a7f00000000000000000000000078bce097dd647907e9a559c4cff7acb3742e57ae6104f2565b9161081460405190565b6318160ddd60e01b815292602084600481845afa9384156109a657600094610a98575b50803b156100e057600061084a60405190565b91829063079cc67960e41b82528183816108688b336004840161073b565b03925af180156109a657610a7a575b506000906108848261056a565b94855b600390610895610108835490565b811015610a02576108a7610108875190565b8810806109c1575b6109ab5761090b60206108d06108cb6108cb61046d868861040e565b6104f2565b6108d9306104f2565b906108e360405190565b938492839182916370a0823160e01b8352600483016001600160a01b03909116815260200190565b03915afa9283156109a6576109378961093287610951978796600091610978575b5061079c565b6107c5565b906109418861056a565b8211610956575b50505060010190565b610887565b6108cb61046d610970946109699361040e565b3390610dea565b803880610948565b610999915060203d811161099f575b6109918183610268565b81019061071b565b3861092c565b503d610987565b61072f565b9661095191506109ba90610788565b9660010190565b506109cf61046d828461040e565b6109fc6109ef6101386109e28c8b610758565b516001600160a01b031690565b916001600160a01b031690565b146108af565b505093509390916107cb610108610a17925190565b10610a6657507f55dba97f0670d744dc3f944eff654b45a97ba6987fdd8e7b484b2ebea6085958610a61610a4a336104f2565b92610a5460405190565b9182918290815260200190565b0390a2565b63bfc2e04960e01b815280600481015b0390fd5b610a92906000610a8a8183610268565b81019061012d565b38610877565b610ab291945060203d60201161099f576109918183610268565b9238610837565b906100f2916106f4565b610acb610c1a565b6100f2610ae9565b6101386101086101089290565b61010890610ad3565b6100f2610af66000610ae0565b610e3e565b6100f2610ac3565b33610b0c610b76565b610b1e6001600160a01b0383166109ef565b03610b2c576100f290610e3e565b63118cdaa760e01b60009081526001600160a01b039091166004526024036000fd5b61010860006105d0565b6100f290610b64610c1a565b6100f290610c95565b6100f290610b58565b61010860016105d0565b6100f290610b8c610c1a565b610bc1565b906001600160a01b03905b9181191691161790565b90610bb6610108610bbd926104f2565b8254610b91565b9055565b610bcc816001610ba6565b610be0610bda6108cb610b4e565b916104f2565b907f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700610c0b60405190565b600090a3565b6100f290610b80565b610c22610b4e565b3390610c2d826109ef565b03610b2c5750565b916001600160a01b0360089290920291821b911b610b9c565b9190610c5f610108610bbd936104f2565b908354610c35565b908154916801000000000000000083101561028a5782610c8f9160016100f29501815561040e565b90610c4e565b90600091610ca28361056a565b6003610caf610108825490565b821015610cf15761046d82610cc39261040e565b610cd56001600160a01b0384166109ef565b14610ce257600101610ca2565b63c50eb08f60e01b8452600484fd5b5050610d06919250610d01600390565b610c67565b7f6e1292104a41acea39635a2d29bb547a5f01d5b629a46ca75ee96e836ebc481d610d3060405190565b600090a1565b6101089081565b6101089054610d36565b610108600261056a565b9060001990610b9c565b90610d6b610108610bbd9261056a565b8254610d51565b610d7c6002610d3d565b610d84610d47565b908114610d96576100f2906002610d5b565b633ee5aeb560e01b6000908152600490fd5b610108600161056a565b6100f2610dbd610da8565b6002610d5b565b610ddd610dd76101089263ffffffff1690565b60e01b90565b6001600160e01b03191690565b610e2d600492610e1e6100f295610e0463a9059cbb610dc4565b92610e0e60405190565b968794602086019081520161073b565b60208201810382520383610268565b610e53565b6100f291600091610c4e565b6100f290610e4e60006001610e32565b610eea565b906000602091610e61600090565b50828151910182855af11561072f573d90600051600092610e846107cb8561056a565b03610ed65750610e93816104f2565b3b610ea06107cb8461056a565b145b610eaa575050565b610a76610eb783926104f2565b635274afe760e01b83526001600160a01b031660048301526024820190565b610ee36107cb600161056a565b1415610ea2565b610f05610bda610efa60006105d0565b6108cb846000610ba6565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0610c0b6040519056fea2646970667358221220b8ac25f93474072d9a0702e0239a96daed41bba72cbac6243e0ca6ae35d0d94e64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000078bce097dd647907e9a559c4cff7acb3742e57ae
-----Decoded View---------------
Arg [0] : _indexToken (address): 0x78BcE097dD647907e9A559c4cFf7Acb3742E57ae
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000078bce097dd647907e9a559c4cff7acb3742e57ae
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| BASE | 100.00% | $0.00125 | 25,987,794.086 | $32,483.18 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.