Bokuto Testnet

Contract

0xB6118Dd4ee6D92A6B4878ca4A011080b906a35EF
Source Code Source Code

Overview

ETH Balance

0 ETH

More Info

Contract Creator

N/A (System Contract)

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Amount

There are no matching entries

Please try again later

Parent Transaction Hash Block From To Amount
View All Internal Transactions

Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xB6118Dd4...b906a35EF in Base Sepolia Testnet
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
AgoraWhitelister

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 100000000 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;

// ====================================================================
//             _        ______     ___   _______          _
//            / \     .' ___  |  .'   `.|_   __ \        / \
//           / _ \   / .'   \_| /  .-.  \ | |__) |      / _ \
//          / ___ \  | |   ____ | |   | | |  __ /      / ___ \
//        _/ /   \ \_\ `.___]  |\  `-'  /_| |  \ \_  _/ /   \ \_
//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|
// ====================================================================
// ======================== AgoraWhitelister ==========================
// ====================================================================

import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import { IAgoraStableSwapFactory } from "stable-swap/contracts/interfaces/IAgoraStableSwapFactory.sol";
import { IAgoraStableSwapPair } from "stable-swap/contracts/interfaces/IAgoraStableSwapPair.sol";

/// @title AgoraWhitelister
/// @notice The AgoraWhitelister is a contract used to whitelist users on all pairs of a testnet
/// @author Agora
contract AgoraWhitelister is Initializable {
    address public factoryAddress;

    constructor() {
        _disableInitializers();
    }

    function initialize(address _factoryAddress) public initializer {
        factoryAddress = _factoryAddress;
    }

    /// @notice Checks if this contract is the whitelister for a given pair
    /// @param _pairAddress The address of the AgoraStableSwapPair to check
    /// @return Returns true if this contract has the WHITELISTER_ROLE on the given pair
    function isWhitelisterOfPair(address _pairAddress) public returns (bool) {
        IAgoraStableSwapPair _pair = IAgoraStableSwapPair(_pairAddress);
        return _pair.hasRole(_pair.WHITELISTER_ROLE(), address(this));
    }

    /// @notice Sets an approved swapper address on all factory-deployed pairs where this contract is the whitelister
    /// @dev This function reverts if the contract lacks WHITELISTER_ROLE on any pair
    /// @param _approvedSwapper The address to approve as a swapper
    function setApprovedSwapper(address _approvedSwapper) public {
        IAgoraStableSwapFactory _factory = IAgoraStableSwapFactory(factoryAddress);
        address[] memory deployedPairs = _factory.allPairs();
        for (uint256 i = 0; i < deployedPairs.length; i++) {
            require(isWhitelisterOfPair(deployedPairs[i]), "The contract is not the whitelister for this pair");
            IAgoraStableSwapPair _pair = IAgoraStableSwapPair(deployedPairs[i]);
            address[] memory _approvedSwappers = new address[](1);
            _approvedSwappers[0] = _approvedSwapper;
            _pair.setApprovedSwappers(_approvedSwappers, true);
        }
    }

    /// @notice The ```Version``` struct is used to represent the version of the AgoraWhitelister
    /// @param major The major version number
    /// @param minor The minor version number
    /// @param patch The patch version number
    struct Version {
        uint256 major;
        uint256 minor;
        uint256 patch;
    }

    /// @notice The ```version``` function returns the version of the AgoraWhitelister
    /// @return _version The version of the AgoraWhitelister
    function version() public pure returns (Version memory _version) {
        _version = Version({ major: 1, minor: 0, patch: 0 });
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.4;

library AgoraStableSwapFactory {
    struct AgoraStableSwapDefaultParamsStorage {
        address initialDefaultAdminAddress;
        address initialDefaultWhitelister;
        address initialDefaultFeeSetter;
        address initialDefaultTokenRemover;
        address initialDefaultPauser;
        address initialDefaultPriceSetter;
        address initialDefaultTokenReceiver;
        address initialDefaultFeeReceiver;
    }

    struct CreatePairArgs {
        address token0;
        uint256 token0Decimals;
        uint256 minToken0PurchaseFee;
        uint256 maxToken0PurchaseFee;
        uint256 token0PurchaseFee;
        address token1;
        uint256 token1Decimals;
        uint256 minToken1PurchaseFee;
        uint256 maxToken1PurchaseFee;
        uint256 token1PurchaseFee;
        uint256 minBasePrice;
        uint256 maxBasePrice;
        uint256 basePrice;
        int256 minAnnualizedInterestRate;
        int256 maxAnnualizedInterestRate;
        int256 annualizedInterestRate;
    }

    struct PairData {
        address pairAddress;
        TokenInfo token0;
        TokenInfo token1;
    }

    struct TokenInfo {
        address tokenAddress;
        string name;
        string symbol;
        uint256 decimals;
    }

    struct Version {
        uint256 major;
        uint256 minor;
        uint256 patch;
    }
}

interface IAgoraStableSwapFactory {
    struct InitializeParams {
        address initialStableSwapImplementation;
        address initialStableSwapProxyAdminAddress;
        address initialFactoryAccessControlManager;
        address initialImplementationSetter;
        address[] initialApprovedDeployers;
        address initialDefaultAdminAddress;
        address initialDefaultWhitelister;
        address initialDefaultFeeSetter;
        address initialDefaultTokenRemover;
        address initialDefaultPauser;
        address initialDefaultPriceSetter;
        address initialDefaultTokenReceiver;
        address initialDefaultFeeReceiver;
    }

    error AddressIsNotRole(string role);
    error CannotRemoveLastManager();
    error DecimalDeltaTooLarge();
    error IdenticalAddresses();
    error InvalidInitialization();
    error InvalidTokenOrder();
    error NotInitializing();
    error PairExists();
    error RoleNameTooLong();
    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
    error ZeroAddress();

    event Initialized(uint64 version);
    event PairCreated(address indexed token0, address indexed token1, address pair);
    event RoleAssigned(string indexed role, address indexed address_);
    event RoleRevoked(string indexed role, address indexed address_);
    event SetApprovedDeployer(address indexed approvedDeployer, bool isApproved);
    event SetDefaultRoles(
        address initialAdminAddress,
        address initialWhitelister,
        address initialFeeSetter,
        address initialTokenRemover,
        address initialPauser,
        address initialPriceSetter,
        address initialTokenReceiver,
        address initialFeeReceiver
    );
    event SetPair(address indexed token0, address indexed token1, address pair);
    event SetStableSwapImplementation(address indexed newImplementation);

    function ACCESS_CONTROL_MANAGER_ROLE() external view returns (string memory);
    function AGORA_ACCESS_CONTROL_STORAGE_SLOT() external view returns (bytes32);
    function AGORA_STABLE_SWAP_FACTORY_STORAGE_SLOT() external view returns (bytes32);
    function APPROVED_DEPLOYER() external view returns (string memory);
    function IMPLEMENTATION_SETTER_ROLE() external view returns (string memory);
    function allPairs() external view returns (address[] memory _pairs);
    function assignRole(string memory _role, address _newAddress, bool _addRole) external;
    function computePairDeploymentAddress(
        address _tokenA,
        address _tokenB
    ) external view returns (address _pairDeploymentAddress);
    function createPair(AgoraStableSwapFactory.CreatePairArgs memory _pairArgs) external returns (address pair);
    function getAgoraStableSwapDefaultParamsStorage()
        external
        view
        returns (AgoraStableSwapFactory.AgoraStableSwapDefaultParamsStorage memory);
    function getAllPairData() external view returns (AgoraStableSwapFactory.PairData[] memory);
    function getAllRoles() external view returns (string[] memory _roles);
    function getPairFromTokens(address _token0, address _token1) external view returns (address);
    function getRoleMembers(string memory _role) external view returns (address[] memory _members);
    function hasRole(string memory _role, address _address) external view returns (bool);
    function implementationAddress() external view returns (address);
    function initialize(InitializeParams memory _params) external;
    function name() external pure returns (string memory);
    function proxyAdminAddress() external view returns (address);
    function setApprovedDeployers(address[] memory _approvedDeployers, bool _setApproved) external;
    function setDefaultRoles(
        address _initialAdminAddress,
        address _initialWhitelister,
        address _initialFeeSetter,
        address _initialTokenRemover,
        address _initialPauser,
        address _initialPriceSetter,
        address _initialTokenReceiver,
        address _initialFeeReceiver
    ) external;
    function setPair(address _tokenA, address _tokenB, address _pairAddress) external;
    function setStableSwapImplementation(address _newImplementation) external;
    function sortTokens(address _tokenA, address _tokenB) external pure returns (address _token0, address _token1);
    function stableSwapImplementation() external view returns (address);
    function stableSwapProxyAdmin() external view returns (address);
    function version() external pure returns (AgoraStableSwapFactory.Version memory _version);
}

File 5 of 4 : IAgoraStableSwapPair.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.4;

library AgoraStableSwapPair {
    struct Version {
        uint256 major;
        uint256 minor;
        uint256 patch;
    }
}

interface IAgoraStableSwapPair {
    struct InitializeParams {
        address token0;
        uint8 token0Decimals;
        address token1;
        uint8 token1Decimals;
        uint256 minToken0PurchaseFee;
        uint256 maxToken0PurchaseFee;
        uint256 minToken1PurchaseFee;
        uint256 maxToken1PurchaseFee;
        uint256 token0PurchaseFee;
        uint256 token1PurchaseFee;
        address initialAdminAddress;
        address initialWhitelister;
        address initialFeeSetter;
        address initialTokenRemover;
        address initialPauser;
        address initialPriceSetter;
        address initialTokenReceiver;
        address initialFeeReceiver;
        uint256 minBasePrice;
        uint256 maxBasePrice;
        int256 minAnnualizedInterestRate;
        int256 maxAnnualizedInterestRate;
        uint256 basePrice;
        int256 annualizedInterestRate;
    }

    error AddressIsNotRole(string role);
    error AnnualizedInterestRateOutOfBounds();
    error BasePriceOutOfBounds();
    error CannotRemoveLastManager();
    error ExcessiveInputAmount();
    error Expired();
    error IncorrectDecimals();
    error InsufficientInputAmount();
    error InsufficientLiquidity();
    error InsufficientOutputAmount();
    error InsufficientTokens();
    error InvalidInitialization();
    error InvalidPath();
    error InvalidPathLength();
    error InvalidSwapAmounts();
    error InvalidToken0PurchaseFee();
    error InvalidToken1PurchaseFee();
    error InvalidTokenAddress();
    error MinAnnualizedInterestRateGreaterThanMax();
    error MinBasePriceGreaterThanMaxBasePrice();
    error MinToken0PurchaseFeeGreaterThanMax();
    error MinToken1PurchaseFeeGreaterThanMax();
    error NotInitializing();
    error PairIsPaused();
    error PriceExpired();
    error ReentrancyGuardReentrantCall();
    error RoleNameTooLong();
    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
    error SafeERC20FailedOperation(address token);

    event CollectFees(address indexed tokenAddress, uint256 amount);
    event ConfigureOraclePrice(uint256 basePrice, int256 annualizedInterestRate);
    event Initialized(uint64 version);
    event RemoveTokens(address indexed tokenAddress, uint256 amount);
    event RoleAssigned(string indexed role, address indexed address_);
    event RoleRevoked(string indexed role, address indexed address_);
    event SetApprovedSwapper(address indexed approvedSwapper, bool isApproved);
    event SetFeeBounds(
        uint256 minToken0PurchaseFee,
        uint256 maxToken0PurchaseFee,
        uint256 minToken1PurchaseFee,
        uint256 maxToken1PurchaseFee
    );
    event SetFeeReceiver(address indexed feeReceiver);
    event SetOraclePriceBounds(
        uint256 minBasePrice,
        uint256 maxBasePrice,
        int256 minAnnualizedInterestRate,
        int256 maxAnnualizedInterestRate
    );
    event SetPaused(bool isPaused);
    event SetTokenPurchaseFees(uint256 token0PurchaseFee, uint256 token1PurchaseFee);
    event SetTokenReceiver(address indexed tokenReceiver);
    event Swap(
        address indexed sender,
        uint256 amount0In,
        uint256 amount1In,
        uint256 amount0Out,
        uint256 amount1Out,
        address indexed to
    );
    event SwapFees(uint256 token0PurchaseFee, uint256 token1PurchaseFee);
    event Sync(uint256 reserve0, uint256 reserve1);

    function ACCESS_CONTROL_MANAGER_ROLE() external view returns (string memory);
    function AGORA_ACCESS_CONTROL_STORAGE_SLOT() external view returns (bytes32);
    function AGORA_STABLE_SWAP_STORAGE_SLOT() external view returns (bytes32);
    function APPROVED_SWAPPER() external view returns (string memory);
    function FEE_PRECISION() external view returns (uint256);
    function FEE_SETTER_ROLE() external view returns (string memory);
    function PAUSER_ROLE() external view returns (string memory);
    function PRICE_PRECISION() external view returns (uint256);
    function PRICE_SETTER_ROLE() external view returns (string memory);
    function TOKEN_REMOVER_ROLE() external view returns (string memory);
    function WHITELISTER_ROLE() external view returns (string memory);
    function addLiquidity(address _tokenAddress, uint256 _amount) external;
    function assignRole(string memory _role, address _newAddress, bool _addRole) external;
    function basePrice() external view returns (uint256);
    function calculatePrice(
        uint256 _priceLastUpdated,
        uint256 _timestamp,
        int256 _perSecondInterestRate,
        uint256 _basePrice
    ) external pure returns (uint256 _price);
    function collectFees(address _tokenAddress, uint256 _amount) external;
    function configureOraclePrice(uint256 _basePrice, int256 _annualizedInterestRate, uint256 _deadline) external;
    function feeReceiverAddress() external view returns (address);
    function getAllRoles() external view returns (string[] memory _roles);
    function getAmount0In(
        uint256 _amount1Out,
        uint256 _token0OverToken1Price,
        uint256 _token1PurchaseFee
    ) external pure returns (uint256 _amount0In, uint256 _token1PurchaseFeeAmount);
    function getAmount0Out(
        uint256 _amount1In,
        uint256 _token0OverToken1Price,
        uint256 _token0PurchaseFee
    ) external pure returns (uint256 _amount0Out, uint256 _token0PurchaseFeeAmount);
    function getAmount1In(
        uint256 _amount0Out,
        uint256 _token0OverToken1Price,
        uint256 _token0PurchaseFee
    ) external pure returns (uint256 _amount1In, uint256 _token0FeeAmount);
    function getAmount1Out(
        uint256 _amount0In,
        uint256 _token0OverToken1Price,
        uint256 _token1PurchaseFee
    ) external pure returns (uint256 _amount1Out, uint256 _token1PurchaseFeeAmount);
    function getAmountsIn(uint256 _amountOut, address[] memory _path) external view returns (uint256[] memory _amounts);
    function getAmountsOut(uint256 _amountIn, address[] memory _path) external view returns (uint256[] memory _amounts);
    function getPrice() external view returns (uint256 _currentPrice);
    function getPrice(uint256 _timestamp) external view returns (uint256 _price);
    function getPriceNormalized() external view returns (uint256 _normalizedPrice);
    function getRoleMembers(string memory _role) external view returns (address[] memory _members);
    function hasRole(string memory _role, address _address) external view returns (bool);
    function implementationAddress() external view returns (address);
    function initialize(InitializeParams memory _params) external;
    function isPaused() external view returns (bool);
    function maxAnnualizedInterestRate() external view returns (int256);
    function maxBasePrice() external view returns (uint256);
    function maxToken0PurchaseFee() external view returns (uint256);
    function maxToken1PurchaseFee() external view returns (uint256);
    function minAnnualizedInterestRate() external view returns (int256);
    function minBasePrice() external view returns (uint256);
    function minToken0PurchaseFee() external view returns (uint256);
    function minToken1PurchaseFee() external view returns (uint256);
    function name() external view returns (string memory);
    function perSecondInterestRate() external view returns (int256);
    function priceLastUpdated() external view returns (uint256);
    function proxyAdminAddress() external view returns (address);
    function removeTokens(address _tokenAddress, uint256 _amount) external;
    function requireValidPath(address[] memory _path, address _token0, address _token1) external pure;
    function reserve0() external view returns (uint256);
    function reserve1() external view returns (uint256);
    function setApprovedSwappers(address[] memory _approvedSwappers, bool _setApproved) external;
    function setFeeBounds(
        uint256 _minToken0PurchaseFee,
        uint256 _maxToken0PurchaseFee,
        uint256 _minToken1PurchaseFee,
        uint256 _maxToken1PurchaseFee
    ) external;
    function setFeeReceiver(address _feeReceiver) external;
    function setOraclePriceBounds(
        uint256 _minBasePrice,
        uint256 _maxBasePrice,
        int256 _minAnnualizedInterestRate,
        int256 _maxAnnualizedInterestRate
    ) external;
    function setPaused(bool _setPaused) external;
    function setTokenPurchaseFees(uint256 _token0PurchaseFee, uint256 _token1PurchaseFee) external;
    function setTokenReceiver(address _tokenReceiver) external;
    function swap(uint256 _amount0Out, uint256 _amount1Out, address _to, bytes memory _data) external;
    function swapExactTokensForTokens(
        uint256 _amountIn,
        uint256 _amountOutMin,
        address[] memory _path,
        address _to,
        uint256 _deadline
    ) external returns (uint256[] memory _amounts);
    function swapTokensForExactTokens(
        uint256 _amountOut,
        uint256 _amountInMax,
        address[] memory _path,
        address _to,
        uint256 _deadline
    ) external returns (uint256[] memory _amounts);
    function sync() external;
    function token0() external view returns (address);
    function token0Decimals() external view returns (uint8);
    function token0FeesAccumulated() external view returns (uint256);
    function token0PurchaseFee() external view returns (uint256);
    function token1() external view returns (address);
    function token1Decimals() external view returns (uint8);
    function token1FeesAccumulated() external view returns (uint256);
    function token1PurchaseFee() external view returns (uint256);
    function tokenReceiverAddress() external view returns (address);
    function version() external pure returns (AgoraStableSwapPair.Version memory _version);
}

Settings
{
  "remappings": [
    "stable-swap/=lib/stable-swap-dev/src/",
    "forge-std/=lib/forge-std/src/",
    "agora-std/=lib/agora-standard-solidity/src/",
    "createx/=node_modules/createx/src/",
    "@interfaces/=src/interfaces/",
    "@utils/=src/sol-utils/",
    "@swap-actions/=src/actions/stable-swap/",
    "@testnet-actions/=src/actions/testnet/",
    "@check-actions/=src/actions/check/",
    "agora-dollar/=node_modules/agora-dollar-dev/src/",
    "solady/=node_modules/solady/",
    "agora-contracts/=node_modules/agora-contracts/src/contracts/",
    "lib/stable-swap-dev/src/contracts/:agora-contracts/=lib/stable-swap-dev/node_modules/agora-contracts/src/contracts/",
    "@chainlink/=lib/agora-standard-solidity/node_modules/@chainlink/",
    "@eth-optimism/=lib/agora-standard-solidity/node_modules/@eth-optimism/",
    "@layerzerolabs/=lib/layerzero-dev/node_modules/@layerzerolabs/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "agora-contracts-old/=node_modules/agora-contracts-old/",
    "agora-dollar-dev/=node_modules/agora-dollar-dev/",
    "agora-dollar-evm-dev/=lib/agora-dollar-evm-dev/src/",
    "agora-standard-solidity/=lib/agora-standard-solidity/src/",
    "contracts/=node_modules/agora-dollar-dev/src/contracts/",
    "ds-test/=node_modules/ds-test/",
    "hardhat-deploy/=lib/layerzero-dev/node_modules/hardhat-deploy/",
    "hardhat/=lib/layerzero-dev/node_modules/hardhat/",
    "interfaces/=node_modules/agora-dollar-dev/src/contracts/interfaces/",
    "layerzero-dev/=lib/layerzero-dev/contracts/",
    "openzeppelin/=node_modules/createx/lib/openzeppelin-contracts/contracts/",
    "script/=node_modules/agora-dollar-dev/src/script/",
    "solidity-bytes-utils/=lib/agora-standard-solidity/node_modules/solidity-bytes-utils/",
    "stable-swap-dev/=lib/stable-swap-dev/src/",
    "test/=node_modules/agora-dollar-dev/src/test/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 100000000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "none",
    "appendCBOR": false
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": true
}

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"inputs":[],"name":"factoryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_factoryAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pairAddress","type":"address"}],"name":"isWhitelisterOfPair","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_approvedSwapper","type":"address"}],"name":"setApprovedSwapper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"components":[{"internalType":"uint256","name":"major","type":"uint256"},{"internalType":"uint256","name":"minor","type":"uint256"},{"internalType":"uint256","name":"patch","type":"uint256"}],"internalType":"struct AgoraWhitelister.Version","name":"_version","type":"tuple"}],"stateMutability":"pure","type":"function"}]

Deployed Bytecode

0x60806040526004361015610011575f80fd5b5f3560e01c8063294c384b1461070257806354fd4d501461068557806389702d0d146102f2578063966dae0e146102a25763c4d66de814610050575f80fd5b3461029e5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261029e5760043573ffffffffffffffffffffffffffffffffffffffff811680910361029e577ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549060ff8260401c16159167ffffffffffffffff811680159081610296575b600114908161028c575b159081610283575b5061025b578260017fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008316177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055610206575b507fffffffffffffffffffffffff00000000000000000000000000000000000000005f5416175f5561017357005b7fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b7fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000001668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00555f610145565b7ff92ee8a9000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050155f6100f2565b303b1591506100ea565b8491506100e0565b5f80fd5b3461029e575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261029e57602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b3461029e5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261029e5760043573ffffffffffffffffffffffffffffffffffffffff811680910361029e576004905f73ffffffffffffffffffffffffffffffffffffffff815416604051938480927fc97682f80000000000000000000000000000000000000000000000000000000082525afa91821561067a575f92610592575b506040919060205f5b8351811015610590576103d373ffffffffffffffffffffffffffffffffffffffff6103cc83876109b9565b51166107c3565b1561050d5773ffffffffffffffffffffffffffffffffffffffff6103f782866109b9565b5116908551916104078784610782565b6001835260208301843682378351156104e057858152813b1561029e5787517f9482910400000000000000000000000000000000000000000000000000000000815260048101899052935160448501819052849160648301915f905b8082106104ae5750505091815f8181956001602483015203925af19182156104a457600192610494575b50016103a1565b5f61049e91610782565b8661048d565b86513d5f823e3d90fd5b9193509160208060019273ffffffffffffffffffffffffffffffffffffffff8751168152019401920186939291610463565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b608485517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f54686520636f6e7472616374206973206e6f74207468652077686974656c697360448201527f74657220666f72207468697320706169720000000000000000000000000000006064820152fd5b005b9091503d805f833e6105a48183610782565b81019060208183031261029e5780519067ffffffffffffffff821161029e570181601f8201121561029e5780519167ffffffffffffffff831161064d578260051b9160208301936105f86040519586610782565b845260208085019382010191821161029e57602001915b818310610620575050509082610398565b825173ffffffffffffffffffffffffffffffffffffffff8116810361029e5781526020928301920161060f565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040513d5f823e3d90fd5b3461029e575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261029e575f604080516106c181610766565b828152826020820152015260606040516106da81610766565b60018152604060208201915f8352015f81526040519160018352516020830152516040820152f35b3461029e5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261029e5760043573ffffffffffffffffffffffffffffffffffffffff8116810361029e5761075c6020916107c3565b6040519015158152f35b6060810190811067ffffffffffffffff82111761064d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761064d57604052565b73ffffffffffffffffffffffffffffffffffffffff166040517f570618e10000000000000000000000000000000000000000000000000000000081525f81600481855afa90811561067a575f916108e3575b50601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe092602060648194604051968795869485937f6c9cd097000000000000000000000000000000000000000000000000000000008552604060048601528051918291826044880152018686015e5f858286010152306024850152011681010301915afa90811561067a575f916108ab575090565b90506020813d6020116108db575b816108c660209383610782565b8101031261029e5751801515810361029e5790565b3d91506108b9565b90503d805f833e6108f48183610782565b81019060208183031261029e5780519067ffffffffffffffff821161029e57019080601f8301121561029e5781519267ffffffffffffffff841161064d576040519161096860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8801160184610782565b8483526020858501011161029e5760206064601f935f83887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09982809a018386015e83010152945050509250610815565b80518210156104e05760209160051b01019056

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0xB6118Dd4ee6D92A6B4878ca4A011080b906a35EF
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.