Contract 0x3568b842cf98bebfcccdec5a2a3844c8cedc2ed3

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x87a1306e9b46676588962e09c2d28327d54181f6a529f550e4f335a516ae8717Withdraw337119572022-09-29 11:52:1659 days 23 hrs ago0x20df8b290c61094c1ae47827d03eb55e769eed9a IN  0x3568b842cf98bebfcccdec5a2a3844c8cedc2ed30 MATIC0.001649160001 30.000000019
0x6e23dfd8c3c1078666d35ebe65f3a9b29edce7a1731306b7ffc10e20b1151cefDeposit337119132022-09-29 11:50:4459 days 23 hrs ago0x20df8b290c61094c1ae47827d03eb55e769eed9a IN  0x3568b842cf98bebfcccdec5a2a3844c8cedc2ed30 MATIC0.012719832622 30.555000018
0x3cfa22a90f4a6ec79589d95b7416f37fee6d5a5383ef9fa0bf82d9b42570a9f20x61016060337118242022-09-29 11:47:4259 days 23 hrs ago0x20df8b290c61094c1ae47827d03eb55e769eed9a IN  Create: PremiumPool0 MATIC0.112839144 33
[ Download CSV Export 
Latest 3 internal transactions
Parent Txn Hash Block From To Value
0x3cfa22a90f4a6ec79589d95b7416f37fee6d5a5383ef9fa0bf82d9b42570a9f2337118242022-09-29 11:47:4259 days 23 hrs ago 0x3568b842cf98bebfcccdec5a2a3844c8cedc2ed3  Contract Creation0 MATIC
0x3cfa22a90f4a6ec79589d95b7416f37fee6d5a5383ef9fa0bf82d9b42570a9f2337118242022-09-29 11:47:4259 days 23 hrs ago 0x3568b842cf98bebfcccdec5a2a3844c8cedc2ed3  Contract Creation0 MATIC
0x3cfa22a90f4a6ec79589d95b7416f37fee6d5a5383ef9fa0bf82d9b42570a9f2337118242022-09-29 11:47:4259 days 23 hrs ago 0x3568b842cf98bebfcccdec5a2a3844c8cedc2ed3  Contract Creation0 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PremiumPool

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 16 : PremiumPool.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/ILendingPoolAddressesProvider.sol";
import "./interfaces/ILendingPool.sol";
import "./interfaces/IAToken.sol";
import "./DrawController.sol";
import "./Ticket.sol";
import "./LendingController.sol";
import "./PremiumPoolStorage.sol";

/**
 * @title PremiumPool
 * @author patricius
 * @notice PremiumPool main contract
 * @dev 
 */
contract PremiumPool is
    Ownable, PremiumPoolStorage
{
    /* ========== EVENTS ========== */

    event Deposit(address indexed user, uint256 usdcAmount);
    event Withdraw(address indexed user, uint256 usdcAmount);
    
    /* ========== CONSTRUCTOR ========== */

    constructor(address _usdc, address _aPoolAddrProvider, address _aToken, address vrfCoordinator, address _link, uint64 _subscriptionId, bytes32 _keyhash) 
        PremiumPoolStorage(_usdc, _aPoolAddrProvider, _aToken, vrfCoordinator, _link, _subscriptionId, _keyhash) {}

    /* ========== FUNCTIONS ========== */

    /**
     * @notice allows users to deposit usdc. Users must manually approve transfer by contract beforehand
     */
    function deposit(uint256 _usdcAmount) public {
        if(userIndex[msg.sender] == 0) {
            userIndex[msg.sender] = users.length;
            users.push(msg.sender);
        }

        lending.deposit(msg.sender, _usdcAmount, address(usdc), address(aPool));
       
        (bool success, ) = address(this).call(abi.encodeWithSignature("mintTicket(address,uint256)", msg.sender, _usdcAmount));
        require(success);

        emit Deposit(msg.sender, _usdcAmount);
    }

    /**
     * @notice allows users to withdraw usdc.
     * @param _usdcAmount usdc amount
     */
    function withdraw(uint256 _usdcAmount) public {
        require(ticket.balanceOf(msg.sender) >= _usdcAmount, "You cannot withdraw more than deposited!");
        require(aToken.balanceOf(address(lending)) >= _usdcAmount, "AToken: You cannot withdraw more than deposited!");

        lending.withdraw(msg.sender, _usdcAmount, address(usdc), address(aToken), address(aPool));

        ticket.burn(msg.sender, _usdcAmount);

        if(ticket.balanceOf(msg.sender) == 0){
            delete users[userIndex[msg.sender]];
            userIndex[msg.sender] = 0;
        }

        emit Withdraw(msg.sender, _usdcAmount);
    }

    /**
     * @notice close the draw and request a random number to pick the winner.
     */
    function pickWinner() public {
        uint256 currentDrawId = draw.drawId();
        (, bool currentDrawIsOpen, , uint256 currentDrawEndTime, , , ) = draw.draws(currentDrawId);

        /* require(block.timestamp >= currentDrawEndTime,"Draw endtime still not reached"); */
        require(currentDrawIsOpen, "Draw already closed");
        require(ticket.totalSupply() != 0, "There has been no participation during this draw");

        uint256 totalDeposit = ticket.totalSupply();
        require(aToken.balanceOf(address(lending))>totalDeposit, "There is no winning prize for this draw");
        uint256 prize = aToken.balanceOf(address(lending)) - totalDeposit;

        draw.updatePrize(prize);
        draw.updateDeposit(totalDeposit);
        draw.closeDraw();
        createNewDraw();
    }

    /**
     * @notice create a new draw
     */
    function createNewDraw() public onlyOwner {
        draw.createDraw();
    }

    /**
     * @notice get list of users
     */
    function getUsers() public view returns (address[] memory) {
        return users;
    }

    /**
     * @notice get draw address
     */
    function getTimeLeft() public view returns (uint256) {
        return draw.timeLeft();
    }

    function mintTicket(address _minter, uint256 _amount) external {
        require(msg.sender == address(this) || msg.sender == address(draw), "You cannot mint tickets!");
        ticket.mint(_minter, _amount);
    }
}

File 2 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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);
    }
}

File 3 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 4 of 16 : ILendingPoolAddressesProvider.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.13;

interface ILendingPoolAddressesProvider {
  function getLendingPool() external view returns (address);
}

File 5 of 16 : ILendingPool.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.13;

interface ILendingPool {
  function withdraw(address asset, uint256 amount, address to) external returns (uint256);
  function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;
}

File 6 of 16 : IAToken.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.13;

interface IAToken {
    function balanceOf(address _user) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function burn(address from, address receiverOfUnderlying, uint256 amount, uint256 index) external;
}

File 7 of 16 : DrawController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol";
import "./PremiumPool.sol";
import "./Ticket.sol";

/**
 * @title Draw
 * @author patricius
 * @notice Contract to handle draws
 * @dev 
 */
contract DrawController is
    Ownable,
    VRFConsumerBaseV2
{
    struct Draw {
        uint256 drawId;
        bool isOpen;
        uint256 startTime;
        uint256 endTime;
        uint256 prize;
        uint256 usdcDeposit;
        address winner;
    }

    /* ========== GLOBAL VARIABLES ========== */

    PremiumPool immutable pool; // pool instance
    PremiumPoolTicket poolTicket; // ticket instance
    uint256 public constant DRAW_DURATION = 24 hours; //duration of every draw
    uint256 public drawId;
    mapping(uint256 => Draw) public draws;

    /* ChainLink VRF v2 parameters */
    VRFCoordinatorV2Interface immutable coordinator;
    uint64 immutable subscriptionId;
    bytes32 immutable keyHash;
    uint256[] public randomWords;
    uint256 public requestId;
    /* */
    LinkTokenInterface immutable link;

    /* ========== EVENTS ========== */

    event DrawCreated(uint256 indexed drawId, uint256 startTime);
    event CloseDraw(uint256 indexed drawId, uint256 endTime);
    event RandomnessRequested(uint256 indexed requestId, uint256 indexed drawId);
    event WinnerElected(uint256 indexed drawId, address indexed winner, uint256 prize);

    /* ========== CONSTRUCTOR ========== */

    constructor(address vrfCoordinator, address _link, uint64 _subscriptionId, bytes32 _keyhash) VRFConsumerBaseV2(vrfCoordinator) {
        coordinator = VRFCoordinatorV2Interface(vrfCoordinator);
        keyHash = _keyhash;
        subscriptionId = _subscriptionId;
        pool = PremiumPool(msg.sender);
        link = LinkTokenInterface(_link);
    }

    /* ========== FUNCTIONS ========== */

    /**
     * @notice create a new draw. Only the Owner contract can create new draws. drawId counter is increased each new draw created.
     */
    function createDraw() external onlyOwner {
        drawId++;
        Draw memory newDraw = Draw({
            drawId: drawId, 
            isOpen: true, 
            startTime: block.timestamp,
            endTime: block.timestamp + DRAW_DURATION,
            prize: 0,
            usdcDeposit: 0,
            winner: address(0)
        });

        draws[drawId] = newDraw;
        
        emit DrawCreated(newDraw.drawId, newDraw.startTime);
    }

    /**
     * @notice close the draw and request a random number to pick the winner.
     */
    function closeDraw() external onlyOwner {
        Draw storage currentDraw = draws[drawId];
        currentDraw.isOpen = false;
        emit CloseDraw(currentDraw.drawId, currentDraw.endTime);

        requestId = coordinator.requestRandomWords(keyHash, subscriptionId, 3, 50000, 2);
        emit RandomnessRequested(requestId, currentDraw.drawId);
    }

    /**
     * @notice fulfillRandomWords override.
     */
    function fulfillRandomWords(uint256, uint256[] memory _randomWords) internal override {
        randomWords = _randomWords;
        Draw storage currentDraw = draws[drawId];
        address[] memory users = pool.getUsers();
        PremiumPoolTicket ticket = PremiumPoolTicket(address(pool.ticket()));
        uint256 rnd = randomWords[0] % ticket.totalSupply();

        for(uint256 i=0; i<users.length; i++) {
            address currentUser = pool.users(i);
            uint256 balance = ticket.balanceOf(currentUser);
            if(rnd < balance) {
                currentDraw.winner = currentUser;
                uint256 prize = currentDraw.prize;
                pool.mintTicket(currentUser, prize);
                emit WinnerElected(drawId, currentUser, prize);
            }
            else{
                rnd -= balance;
            }
        }
    }

    function updatePrize(uint256 _prize) public onlyOwner {
        draws[drawId].prize = _prize;
    }

    function updateDeposit(uint256 _usdcDeposit) public onlyOwner {
        draws[drawId].usdcDeposit = _usdcDeposit;
    }

    function cancelVRFSubscription() external {
        coordinator.cancelSubscription(subscriptionId, msg.sender);
    }
  
    function fundVRFSubscription(uint96 amount) public {
        link.transferAndCall(address(coordinator), amount, abi.encode(subscriptionId));
    }

    /**
     * @notice returns the time left before the deadline to the frontend
     */
    function timeLeft() public view returns(uint256) {
        uint256 deadline = draws[drawId].endTime;
        if (block.timestamp>=deadline)
            return 0;
        else
            return deadline-block.timestamp;
    }
}

File 8 of 16 : Ticket.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract PremiumPoolTicket is ERC20, Ownable {
    constructor() ERC20("PremiumPoolTicket", "PPT") {}

    function mint(address _minter, uint256 _amount) public onlyOwner {
        super._mint(_minter , _amount);
    }

    function burn(address _account, uint256 _amount) public onlyOwner {
        super._burn(_account , _amount);
    }

    function decimals() public view virtual override returns (uint8) {
        return 6;
    }
}

File 9 of 16 : LendingController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/ILendingPool.sol";
import "./interfaces/IAToken.sol";

/**
 * @title LendingController
 * @author patricius
 * @notice PremiumPool lending controller
 * @dev 
 */
contract LendingController is
    Ownable
{
    /* ========== FUNCTIONS ========== */

    /**
     * @notice allows users to deposit usdc. Users must manually approve transfer by contract beforehand
     */
    function deposit(address sender, uint256 _usdcAmount, address _usdc, address _aPool) public {
        IERC20(_usdc).transferFrom(sender, address(this), _usdcAmount);
        IERC20(_usdc).approve(address(_aPool), _usdcAmount);
        ILendingPool(_aPool).deposit(address(_usdc), _usdcAmount, address(this), 0); // REMOVED FOR TESTING PURPOSES
    }

     /**
     * @notice allows users to withdraw usdc.
     * @param _usdcAmount usdc amount
     */
    function withdraw(address sender, uint256 _usdcAmount, address _usdc, address aToken, address _aPool) public {
        IAToken(aToken).approve(address(_aPool), _usdcAmount);
        ILendingPool(_aPool).withdraw(address(_usdc), _usdcAmount, sender); // REMOVED FOR TESTING PURPOSES
        //IERC20(_usdc).transfer(sender, _usdcAmount);
    }
}

File 10 of 16 : PremiumPoolStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/ILendingPoolAddressesProvider.sol";
import "./interfaces/ILendingPool.sol";
import "./interfaces/IAToken.sol";
import "./DrawController.sol";
import "./Ticket.sol";
import "./LendingController.sol";

/**
 * @title PremiumPoolStorage
 * @author patricius
 * @notice PremiumPool storage
 * @dev 
 */
contract PremiumPoolStorage is
    Ownable
{
    /* ========== GLOBAL VARIABLES ========== */

    DrawController public immutable draw; // draw controller instance
    LendingController public immutable lending; // lending controller instance
    IERC20 immutable usdc; // $USDC instance
    PremiumPoolTicket public immutable ticket; // ticket instance
    ILendingPoolAddressesProvider immutable aProvider; // aave address registry
    ILendingPool immutable aPool; // aave usdc lending pool
    IAToken immutable aToken; // aave interest bearing token

    mapping(address => uint256) public userIndex;
    address[] public users;

    /* ========== CONSTRUCTOR ========== */

    constructor(address _usdc, address _aPoolAddrProvider, address _aToken, address vrfCoordinator, address _link, uint64 _subscriptionId, bytes32 _keyhash) {
        usdc = IERC20(_usdc);
        ticket = new PremiumPoolTicket();
        aProvider = ILendingPoolAddressesProvider(address(_aPoolAddrProvider));
        aPool = ILendingPool(aProvider.getLendingPool());
        aToken = IAToken(_aToken);
        draw = new DrawController(vrfCoordinator, _link, _subscriptionId, _keyhash);
        lending = new LendingController();
        users = new address[](0);
    }
}

File 11 of 16 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 12 of 16 : VRFConsumerBaseV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness. It ensures 2 things:
 * @dev 1. The fulfillment came from the VRFCoordinator
 * @dev 2. The consumer contract implements fulfillRandomWords.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constructor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash). Create subscription, fund it
 * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
 * @dev subscription management functions).
 * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
 * @dev callbackGasLimit, numWords),
 * @dev see (VRFCoordinatorInterface for a description of the arguments).
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomWords method.
 *
 * @dev The randomness argument to fulfillRandomWords is a set of random words
 * @dev generated from your requestId and the blockHash of the request.
 *
 * @dev If your contract could have concurrent requests open, you can use the
 * @dev requestId returned from requestRandomWords to track which response is associated
 * @dev with which randomness request.
 * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ.
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request. It is for this reason that
 * @dev that you can signal to an oracle you'd like them to wait longer before
 * @dev responding to the request (however this is not enforced in the contract
 * @dev and so remains effective only in the case of unmodified oracle software).
 */
abstract contract VRFConsumerBaseV2 {
  error OnlyCoordinatorCanFulfill(address have, address want);
  address private immutable vrfCoordinator;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   */
  constructor(address _vrfCoordinator) {
    vrfCoordinator = _vrfCoordinator;
  }

  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomWords the VRF output expanded to the requested number of words
   */
  function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
    if (msg.sender != vrfCoordinator) {
      revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
    }
    fulfillRandomWords(requestId, randomWords);
  }
}

File 13 of 16 : VRFCoordinatorV2Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface VRFCoordinatorV2Interface {
  /**
   * @notice Get configuration relevant for making requests
   * @return minimumRequestConfirmations global min for request confirmations
   * @return maxGasLimit global max for request gas limit
   * @return s_provingKeyHashes list of registered key hashes
   */
  function getRequestConfig()
    external
    view
    returns (
      uint16,
      uint32,
      bytes32[] memory
    );

  /**
   * @notice Request a set of random words.
   * @param keyHash - Corresponds to a particular oracle job which uses
   * that key for generating the VRF proof. Different keyHash's have different gas price
   * ceilings, so you can select a specific one to bound your maximum per request cost.
   * @param subId  - The ID of the VRF subscription. Must be funded
   * with the minimum subscription balance required for the selected keyHash.
   * @param minimumRequestConfirmations - How many blocks you'd like the
   * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
   * for why you may want to request more. The acceptable range is
   * [minimumRequestBlockConfirmations, 200].
   * @param callbackGasLimit - How much gas you'd like to receive in your
   * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
   * may be slightly less than this amount because of gas used calling the function
   * (argument decoding etc.), so you may need to request slightly more than you expect
   * to have inside fulfillRandomWords. The acceptable range is
   * [0, maxGasLimit]
   * @param numWords - The number of uint256 random values you'd like to receive
   * in your fulfillRandomWords callback. Note these numbers are expanded in a
   * secure way by the VRFCoordinator from a single random value supplied by the oracle.
   * @return requestId - A unique identifier of the request. Can be used to match
   * a request to a response in fulfillRandomWords.
   */
  function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);

  /**
   * @notice Create a VRF subscription.
   * @return subId - A unique subscription id.
   * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
   * @dev Note to fund the subscription, use transferAndCall. For example
   * @dev  LINKTOKEN.transferAndCall(
   * @dev    address(COORDINATOR),
   * @dev    amount,
   * @dev    abi.encode(subId));
   */
  function createSubscription() external returns (uint64 subId);

  /**
   * @notice Get a VRF subscription.
   * @param subId - ID of the subscription
   * @return balance - LINK balance of the subscription in juels.
   * @return reqCount - number of requests for this subscription, determines fee tier.
   * @return owner - owner of the subscription.
   * @return consumers - list of consumer address which are able to use this subscription.
   */
  function getSubscription(uint64 subId)
    external
    view
    returns (
      uint96 balance,
      uint64 reqCount,
      address owner,
      address[] memory consumers
    );

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @param newOwner - proposed new owner of the subscription
   */
  function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @dev will revert if original owner of subId has
   * not requested that msg.sender become the new owner.
   */
  function acceptSubscriptionOwnerTransfer(uint64 subId) external;

  /**
   * @notice Add a consumer to a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - New consumer which can use the subscription
   */
  function addConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Remove a consumer from a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - Consumer to remove from the subscription
   */
  function removeConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Cancel a subscription
   * @param subId - ID of the subscription
   * @param to - Where to send the remaining LINK to
   */
  function cancelSubscription(uint64 subId, address to) external;

  /*
   * @notice Check to see if there exists a request commitment consumers
   * for all consumers and keyhashes for a given sub.
   * @param subId - ID of the subscription
   * @return true if there exists at least one unfulfilled request for the subscription, false
   * otherwise.
   */
  function pendingRequestExists(uint64 subId) external view returns (bool);
}

File 14 of 16 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

  function balanceOf(address owner) external view returns (uint256 balance);

  function decimals() external view returns (uint8 decimalPlaces);

  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);

  function increaseApproval(address spender, uint256 subtractedValue) external;

  function name() external view returns (string memory tokenName);

  function symbol() external view returns (string memory tokenSymbol);

  function totalSupply() external view returns (uint256 totalTokensIssued);

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  ) external returns (bool success);

  function transferFrom(
    address from,
    address to,
    uint256 value
  ) external returns (bool success);
}

File 15 of 16 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 16 of 16 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

Settings
{
  "remappings": [
    "@chainlink/=lib/chainlink/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "chainlink/=lib/chainlink/contracts/src/v0.8/dev/vendor/@arbitrum/nitro-contracts/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "protocol-v2/=lib/protocol-v2/",
    "protocol-v3/=lib/protocol-v3/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_usdc","type":"address"},{"internalType":"address","name":"_aPoolAddrProvider","type":"address"},{"internalType":"address","name":"_aToken","type":"address"},{"internalType":"address","name":"vrfCoordinator","type":"address"},{"internalType":"address","name":"_link","type":"address"},{"internalType":"uint64","name":"_subscriptionId","type":"uint64"},{"internalType":"bytes32","name":"_keyhash","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"usdcAmount","type":"uint256"}],"name":"Deposit","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":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"usdcAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"createNewDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_usdcAmount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"draw","outputs":[{"internalType":"contract DrawController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimeLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUsers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lending","outputs":[{"internalType":"contract LendingController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintTicket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pickWinner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract PremiumPoolTicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"users","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_usdcAmount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101606040523480156200001257600080fd5b5060405162004172380380620041728339810160408190526200003591620002fd565b868686868686866200004733620001e5565b6001600160a01b03871660c052604051620000629062000235565b604051809103906000f0801580156200007f573d6000803e3d6000fd5b506001600160a01b0390811660e052861661010081905260408051630261bf8b60e01b81529051630261bf8b916004808201926020929091908290030181865afa158015620000d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f8919062000399565b6001600160a01b03908116610120528516610140526040518490849084908490620001239062000243565b6001600160a01b0394851681529390921660208401526001600160401b031660408301526060820152608001604051809103906000f0801580156200016c573d6000803e3d6000fd5b506001600160a01b0316608052604051620001879062000251565b604051809103906000f080158015620001a4573d6000803e3d6000fd5b506001600160a01b031660a0526040805160008152602081019182905251620001d0916002916200025f565b505050505050505050505050505050620003be565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610ec4806200199883390190565b6112ea806200285c83390190565b61062c8062003b4683390190565b828054828255906000526020600020908101928215620002b7579160200282015b82811115620002b757825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000280565b50620002c5929150620002c9565b5090565b5b80821115620002c55760008155600101620002ca565b80516001600160a01b0381168114620002f857600080fd5b919050565b600080600080600080600060e0888a0312156200031957600080fd5b6200032488620002e0565b96506200033460208901620002e0565b95506200034460408901620002e0565b94506200035460608901620002e0565b93506200036460808901620002e0565b60a08901519093506001600160401b03811681146200038257600080fd5b8092505060c0880151905092959891949750929550565b600060208284031215620003ac57600080fd5b620003b782620002e0565b9392505050565b60805160a05160c05160e0516101005161012051610140516114da620004be600039600081816103f50152818161051501528181610a950152610ba101526000818161053d0152610f610152600050506000818161018b015281816102dd015281816105db01528181610654015281816108e5015281816109d10152610e4b0152600081816104ed0152610f390152600081816101cb015281816103cb0152818161056501528181610a6801528181610b740152610f8901526000818161011c015281816107830152818161080a01528181610c2f01528181610ca701528181610d0f01528181610db7015281816110bf01526111c701526114da6000f3fe608060405234801561001057600080fd5b50600436106100f45760003560e01c80638da5cb5b11610097578063c7e284b811610066578063c7e284b814610213578063c96679fe14610229578063f2fde38b14610249578063fea2920e1461025c57600080fd5b80638da5cb5b146101b557806395e97eee146101c6578063a5f7f466146101ed578063b6b55f251461020057600080fd5b8063365b98b2116100d3578063365b98b21461016b5780635d495aea1461017e5780636cc25db714610186578063715018a6146101ad57600080fd5b8062ce8e3e146100f95780630eecae21146101175780632e1a7d4d14610156575b600080fd5b610101610264565b60405161010e91906112e4565b60405180910390f35b61013e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161010e565b610169610164366004611331565b6102c6565b005b61013e610179366004611331565b610755565b61016961077f565b61013e7f000000000000000000000000000000000000000000000000000000000000000081565b610169610d8f565b6000546001600160a01b031661013e565b61013e7f000000000000000000000000000000000000000000000000000000000000000081565b6101696101fb36600461135f565b610da3565b61016961020e366004611331565b610eab565b61021b6110bb565b60405190815260200161010e565b61021b61023736600461138b565b60016020526000908152604090205481565b61016961025736600461138b565b611144565b6101696111bd565b606060028054806020026020016040519081016040528092919081815260200182805480156102bc57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161029e575b5050505050905090565b6040516370a0823160e01b815233600482015281907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561032c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035091906113af565b10156103b45760405162461bcd60e51b815260206004820152602860248201527f596f752063616e6e6f74207769746864726177206d6f7265207468616e206465604482015267706f73697465642160c01b60648201526084015b60405180910390fd5b6040516370a0823160e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015282917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa15801561043e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046291906113af565b10156104c95760405162461bcd60e51b815260206004820152603060248201527f41546f6b656e3a20596f752063616e6e6f74207769746864726177206d6f726560448201526f207468616e206465706f73697465642160801b60648201526084016103ab565b60405163d39d3d0f60e01b8152336004820152602481018290526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660448301527f0000000000000000000000000000000000000000000000000000000000000000811660648301527f0000000000000000000000000000000000000000000000000000000000000000811660848301527f0000000000000000000000000000000000000000000000000000000000000000169063d39d3d0f9060a401600060405180830381600087803b1580156105a957600080fd5b505af11580156105bd573d6000803e3d6000fd5b5050604051632770a7eb60e21b8152336004820152602481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169250639dc29fac9150604401600060405180830381600087803b15801561062957600080fd5b505af115801561063d573d6000803e3d6000fd5b50506040516370a0823160e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506370a082319150602401602060405180830381865afa1580156106a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c991906113af565b60000361071d57336000908152600160205260409020546002805490919081106106f5576106f56113c8565b6000918252602080832090910180546001600160a01b03191690553382526001905260408120555b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a250565b6002818154811061076557600080fd5b6000918252602090912001546001600160a01b0316905081565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663eb0e81d46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080391906113af565b90506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630cc36c36846040518263ffffffff1660e01b815260040161085691815260200190565b60e060405180830381865afa158015610873573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089791906113de565b505050935050925050816108e35760405162461bcd60e51b8152602060048201526013602482015272111c985dc8185b1c9958591e4818db1bdcd959606a1b60448201526064016103ab565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610941573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096591906113af565b6000036109cd5760405162461bcd60e51b815260206004820152603060248201527f546865726520686173206265656e206e6f2070617274696369706174696f6e2060448201526f647572696e672074686973206472617760801b60648201526084016103ab565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5191906113af565b6040516370a0823160e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015291925082917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0091906113af565b11610b5d5760405162461bcd60e51b815260206004820152602760248201527f5468657265206973206e6f2077696e6e696e67207072697a6520666f722074686044820152666973206472617760c81b60648201526084016103ab565b6040516370a0823160e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260009183917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610be8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0c91906113af565b610c16919061144e565b6040516396d8131760e01b8152600481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906396d8131790602401600060405180830381600087803b158015610c7b57600080fd5b505af1158015610c8f573d6000803e3d6000fd5b5050604051630467a75960e21b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316925063119e9d649150602401600060405180830381600087803b158015610cf557600080fd5b505af1158015610d09573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a0eb55706040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d6857600080fd5b505af1158015610d7c573d6000803e3d6000fd5b50505050610d886111bd565b5050505050565b610d9761123a565b610da16000611294565b565b33301480610dd95750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b610e255760405162461bcd60e51b815260206004820152601860248201527f596f752063616e6e6f74206d696e74207469636b65747321000000000000000060448201526064016103ab565b6040516340c10f1960e01b81526001600160a01b038381166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b158015610e8f57600080fd5b505af1158015610ea3573d6000803e3d6000fd5b505050505050565b336000908152600160205260408120549003610f155760028054336000818152600160208190526040822084905583018455929092527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b03191690911790555b60405163c6f1649f60e01b8152336004820152602481018290526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660448301527f0000000000000000000000000000000000000000000000000000000000000000811660648301527f0000000000000000000000000000000000000000000000000000000000000000169063c6f1649f90608401600060405180830381600087803b158015610fcd57600080fd5b505af1158015610fe1573d6000803e3d6000fd5b5050604051336024820152604481018490526000925030915060640160408051601f198184030181529181526020820180516001600160e01b03166352fbfa3360e11b179052516110329190611475565b6000604051808303816000865af19150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b505090508061108257600080fd5b60405182815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a25050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631300a6d16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561111b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113f91906113af565b905090565b61114c61123a565b6001600160a01b0381166111b15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ab565b6111ba81611294565b50565b6111c561123a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663677d540d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50505050565b6000546001600160a01b03163314610da15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ab565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6020808252825182820181905260009190848201906040850190845b818110156113255783516001600160a01b031683529284019291840191600101611300565b50909695505050505050565b60006020828403121561134357600080fd5b5035919050565b6001600160a01b03811681146111ba57600080fd5b6000806040838503121561137257600080fd5b823561137d8161134a565b946020939093013593505050565b60006020828403121561139d57600080fd5b81356113a88161134a565b9392505050565b6000602082840312156113c157600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b600080600080600080600060e0888a0312156113f957600080fd5b875196506020880151801515811461141057600080fd5b8096505060408801519450606088015193506080880151925060a0880151915060c088015161143e8161134a565b8091505092959891949750929550565b8181038181111561146f57634e487b7160e01b600052601160045260246000fd5b92915050565b6000825160005b81811015611496576020818601810151858301520161147c565b50600092019182525091905056fea2646970667358221220dc178fa09861ac81ec588616d0b8ccdbb4fe164489e356eec984f27a5e32393964736f6c6343000810003360806040523480156200001157600080fd5b5060405180604001604052806011815260200170141c995b5a5d5b541bdbdb151a58dad95d607a1b8152506040518060400160405280600381526020016214141560ea1b815250816003908162000069919062000196565b50600462000078828262000196565b505050620000956200008f6200009b60201b60201c565b6200009f565b62000262565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200011c57607f821691505b6020821081036200013d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019157600081815260208120601f850160051c810160208610156200016c5750805b601f850160051c820191505b818110156200018d5782815560010162000178565b5050505b505050565b81516001600160401b03811115620001b257620001b2620000f1565b620001ca81620001c3845462000107565b8462000143565b602080601f831160018114620002025760008415620001e95750858301515b600019600386901b1c1916600185901b1785556200018d565b600085815260208120601f198616915b82811015620002335788860151825594840194600190910190840162000212565b5085821015620002525787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b610c5280620002726000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610209578063a9059cbb1461021c578063dd62ed3e1461022f578063f2fde38b1461024257600080fd5b8063715018a6146101cb5780638da5cb5b146101d357806395d89b41146101ee5780639dc29fac146101f657600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d610255565b60405161011a9190610a9c565b60405180910390f35b610136610131366004610b06565b6102e7565b604051901515815260200161011a565b6002545b60405190815260200161011a565b610136610166366004610b30565b610301565b6040516006815260200161011a565b610136610188366004610b06565b610325565b6101a061019b366004610b06565b610347565b005b61014a6101b0366004610b6c565b6001600160a01b031660009081526020819052604090205490565b6101a061035d565b6005546040516001600160a01b03909116815260200161011a565b61010d610371565b6101a0610204366004610b06565b610380565b610136610217366004610b06565b610392565b61013661022a366004610b06565b610412565b61014a61023d366004610b8e565b610420565b6101a0610250366004610b6c565b61044b565b60606003805461026490610bc1565b80601f016020809104026020016040519081016040528092919081815260200182805461029090610bc1565b80156102dd5780601f106102b2576101008083540402835291602001916102dd565b820191906000526020600020905b8154815290600101906020018083116102c057829003601f168201915b5050505050905090565b6000336102f58185856104c4565b60019150505b92915050565b60003361030f8582856105e9565b61031a858585610663565b506001949350505050565b6000336102f58185856103388383610420565b6103429190610bfb565b6104c4565b61034f610807565b6103598282610861565b5050565b610365610807565b61036f6000610920565b565b60606004805461026490610bc1565b610388610807565b6103598282610972565b600033816103a08286610420565b9050838110156104055760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b61031a82868684036104c4565b6000336102f5818585610663565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610453610807565b6001600160a01b0381166104b85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103fc565b6104c181610920565b50565b6001600160a01b0383166105265760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103fc565b6001600160a01b0382166105875760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103fc565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006105f58484610420565b9050600019811461065d57818110156106505760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103fc565b61065d84848484036104c4565b50505050565b6001600160a01b0383166106c75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103fc565b6001600160a01b0382166107295760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103fc565b6001600160a01b038316600090815260208190526040902054818110156107a15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103fc565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361065d565b6005546001600160a01b0316331461036f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103fc565b6001600160a01b0382166108b75760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103fc565b80600260008282546108c99190610bfb565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166109d25760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103fc565b6001600160a01b03821660009081526020819052604090205481811015610a465760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103fc565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016105dc565b600060208083528351808285015260005b81811015610ac957858101830151858201604001528201610aad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610b0157600080fd5b919050565b60008060408385031215610b1957600080fd5b610b2283610aea565b946020939093013593505050565b600080600060608486031215610b4557600080fd5b610b4e84610aea565b9250610b5c60208501610aea565b9150604084013590509250925092565b600060208284031215610b7e57600080fd5b610b8782610aea565b9392505050565b60008060408385031215610ba157600080fd5b610baa83610aea565b9150610bb860208401610aea565b90509250929050565b600181811c90821680610bd557607f821691505b602082108103610bf557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156102fb57634e487b7160e01b600052601160045260246000fdfea26469706673582212207c93f6dc5501238817319878d898195abdc8d0e2579496f3b22c4f5bcc3d805f64736f6c6343000810003361014060405234801561001157600080fd5b50604051620012ea380380620012ea833981016040819052610032916100da565b8361003c3361006e565b6001600160a01b0390811660805293841660c052610100526001600160401b031660e0523360a0521661012052610134565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100d557600080fd5b919050565b600080600080608085870312156100f057600080fd5b6100f9856100be565b9350610107602086016100be565b60408601519093506001600160401b038116811461012457600080fd5b6060959095015193969295505050565b60805160a05160c05160e051610100516101205161112e620001bc60003960006103a3015260006106200152600081816103740152818161064f01526107e90152600081816103cc0152818161068c01526108160152600081816109070152818161099001528181610ac60152610bf90152600081816102e30152610325015261112e6000f3fe608060405234801561001057600080fd5b50600436106100ff5760003560e01c80638da5cb5b11610097578063d733eddb11610066578063d733eddb14610253578063eb0e81d41461025d578063f2fde38b14610266578063f726272c1461027957600080fd5b80638da5cb5b1461020a57806396d8131714610225578063a0eb557014610238578063beff730f1461024057600080fd5b80631fe543e3116100d35780631fe543e3146101d45780632f902f07146101e7578063677d540d146101fa578063715018a61461020257600080fd5b80626d6cae146101045780630cc36c3614610120578063119e9d64146101b75780631300a6d1146101cc575b600080fd5b61010d60055481565b6040519081526020015b60405180910390f35b61017961012e366004610d73565b60036020819052600091825260409091208054600182015460028301549383015460048401546005850154600690950154939560ff909316949293919290916001600160a01b031687565b604080519788529515156020880152948601939093526060850191909152608084015260a08301526001600160a01b031660c082015260e001610117565b6101ca6101c5366004610d73565b610281565b005b61010d6102a0565b6101ca6101e2366004610df7565b6102d8565b6101ca6101f5366004610e99565b610365565b6101ca61045f565b6101ca61057e565b6000546040516001600160a01b039091168152602001610117565b6101ca610233366004610d73565b610592565b6101ca6105b1565b61010d61024e366004610d73565b610737565b61010d6201518081565b61010d60025481565b6101ca610274366004610ee3565b610758565b6101ca6107d1565b61028961087c565b600254600090815260036020526040902060050155565b6002546000908152600360208190526040822001544281116102c457600091505090565b6102ce4282610f16565b91505090565b5090565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103575760405163073e64fd60e21b81523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b61036182826108d6565b5050565b6040805167ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660208201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691634000aea0917f0000000000000000000000000000000000000000000000000000000000000000918591016040516020818303038152906040526040518463ffffffff1660e01b815260040161041c93929190610f2f565b6020604051808303816000875af115801561043b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103619190610fa2565b61046761087c565b6002805490600061047783610fc4565b919050555060006040518060e00160405280600254815260200160011515815260200142815260200162015180426104af9190610fdd565b8152600060208083018290526040808401839052606093840183905260028054845260038084529382902086518082558785015160018301805460ff19169115159190911790558784015192820183905595870151948101949094556080860151600485015560a0860151600585015560c0860151600690940180546001600160a01b0319166001600160a01b03909516949094179093555191825292935090917f9e5aa1895cac644f584979428802a3ac9d38f05cfc30e374b4f236cf36fb1009910160405180910390a250565b61058661087c565b6105906000610ccc565b565b61059a61087c565b600254600090815260036020526040902060040155565b6105b961087c565b60025460009081526003602081815260409283902060018101805460ff191690558054928101549351938452927fbecb21e6c69b7c34ed408ac0924e234fd9632ca0107bed0f64b80cd864262ce2910160405180910390a26040516305d3b1d360e41b81527f0000000000000000000000000000000000000000000000000000000000000000600482015267ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526003604482015261c3506064820152600260848201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156106dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107019190610ff0565b600581905581546040519091907f3d94fecedaa4f90b8bd459797adb95f5bb11426025c5541390d9ccc1ad1b60a190600090a350565b6004818154811061074757600080fd5b600091825260209091200154905081565b61076061087c565b6001600160a01b0381166107c55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034e565b6107ce81610ccc565b50565b604051630d7ae1d360e41b815267ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d7ae1d3090604401600060405180830381600087803b15801561086257600080fd5b505af1158015610876573d6000803e3d6000fd5b50505050565b6000546001600160a01b031633146105905760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034e565b80516108e9906004906020840190610d1c565b506000600360006002548152602001908152602001600020905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031662ce8e3e6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610962573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261098a9190810190611009565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636cc25db76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1091906110a3565b90506000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a769190610ff0565b6004600081548110610a8a57610a8a6110c0565b9060005260206000200154610a9f91906110d6565b905060005b8351811015610cc357604051631b2dcc5960e11b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063365b98b290602401602060405180830381865afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3991906110a3565b6040516370a0823160e01b81526001600160a01b0380831660048301529192506000918616906370a0823190602401602060405180830381865afa158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba99190610ff0565b905080841015610ca1576006870180546001600160a01b0319166001600160a01b038481169182179092556004808a01546040516352fbfa3360e11b8152918201929092526024810182905290917f0000000000000000000000000000000000000000000000000000000000000000169063a5f7f46690604401600060405180830381600087803b158015610c3d57600080fd5b505af1158015610c51573d6000803e3d6000fd5b50505050826001600160a01b03166002547f20ed321e36ce6055818695327e26077db1db6ead945b3b25c364625169b30c7b83604051610c9391815260200190565b60405180910390a350610cae565b610cab8185610f16565b93505b50508080610cbb90610fc4565b915050610aa4565b50505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054828255906000526020600020908101928215610d57579160200282015b82811115610d57578251825591602001919060010190610d3c565b506102d49291505b808211156102d45760008155600101610d5f565b600060208284031215610d8557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610dcb57610dcb610d8c565b604052919050565b600067ffffffffffffffff821115610ded57610ded610d8c565b5060051b60200190565b60008060408385031215610e0a57600080fd5b8235915060208084013567ffffffffffffffff811115610e2957600080fd5b8401601f81018613610e3a57600080fd5b8035610e4d610e4882610dd3565b610da2565b81815260059190911b82018301908381019088831115610e6c57600080fd5b928401925b82841015610e8a57833582529284019290840190610e71565b80955050505050509250929050565b600060208284031215610eab57600080fd5b81356bffffffffffffffffffffffff81168114610ec757600080fd5b9392505050565b6001600160a01b03811681146107ce57600080fd5b600060208284031215610ef557600080fd5b8135610ec781610ece565b634e487b7160e01b600052601160045260246000fd5b81810381811115610f2957610f29610f00565b92915050565b60018060a01b0384168152600060206bffffffffffffffffffffffff85168184015260606040840152835180606085015260005b81811015610f7f57858101830151858201608001528201610f63565b506000608082860101526080601f19601f83011685010192505050949350505050565b600060208284031215610fb457600080fd5b81518015158114610ec757600080fd5b600060018201610fd657610fd6610f00565b5060010190565b80820180821115610f2957610f29610f00565b60006020828403121561100257600080fd5b5051919050565b6000602080838503121561101c57600080fd5b825167ffffffffffffffff81111561103357600080fd5b8301601f8101851361104457600080fd5b8051611052610e4882610dd3565b81815260059190911b8201830190838101908783111561107157600080fd5b928401925b8284101561109857835161108981610ece565b82529284019290840190611076565b979650505050505050565b6000602082840312156110b557600080fd5b8151610ec781610ece565b634e487b7160e01b600052603260045260246000fd5b6000826110f357634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212204cdc04b98db23b6491355cab7ab86c5545b518feba8a7d9ddfdc02cbc2d3b07d64736f6c63430008100033608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105ae8061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b14610066578063c6f1649f14610085578063d39d3d0f14610098578063f2fde38b146100ab575b600080fd5b6100646100be565b005b600054604080516001600160a01b039092168252519081900360200190f35b610064610093366004610470565b6100d2565b6100646100a63660046104bd565b610235565b6100646100b936600461051b565b61032c565b6100c66103aa565b6100d06000610404565b565b6040516323b872dd60e01b81526001600160a01b038581166004830152306024830152604482018590528316906323b872dd906064016020604051808303816000875af1158015610127573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014b919061053d565b5060405163095ea7b360e01b81526001600160a01b0382811660048301526024820185905283169063095ea7b3906044016020604051808303816000875af115801561019b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bf919061053d565b5060405163e8eda9df60e01b81526001600160a01b038381166004830152602482018590523060448301526000606483015282169063e8eda9df90608401600060405180830381600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b5050505050505050565b60405163095ea7b360e01b81526001600160a01b0382811660048301526024820186905283169063095ea7b3906044016020604051808303816000875af1158015610284573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a8919061053d565b50604051631a4ca37b60e21b81526001600160a01b0384811660048301526024820186905286811660448301528216906369328dec906064016020604051808303816000875af1158015610300573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610324919061055f565b505050505050565b6103346103aa565b6001600160a01b03811661039e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6103a781610404565b50565b6000546001600160a01b031633146100d05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610395565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461046b57600080fd5b919050565b6000806000806080858703121561048657600080fd5b61048f85610454565b9350602085013592506104a460408601610454565b91506104b260608601610454565b905092959194509250565b600080600080600060a086880312156104d557600080fd5b6104de86610454565b9450602086013593506104f360408701610454565b925061050160608701610454565b915061050f60808701610454565b90509295509295909350565b60006020828403121561052d57600080fd5b61053682610454565b9392505050565b60006020828403121561054f57600080fd5b8151801515811461053657600080fd5b60006020828403121561057157600080fd5b505191905056fea2646970667358221220070db5f63f2f59ab23e16db4eebe4499689f077cc8d473f98fcca7ef50d670a264736f6c634300081000330000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000d05e3e715d945b59290df0ae8ef85c1bdb6847440000000000000000000000001a13f4ca1d028320a707d99520abfefca3998b7f000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f100000000000000000000000000000000000000000000000000000000000001466e099d640cde6de9d40ac749b4b594126b0169747122711109c9985d47751f93

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000d05e3e715d945b59290df0ae8ef85c1bdb6847440000000000000000000000001a13f4ca1d028320a707d99520abfefca3998b7f000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f100000000000000000000000000000000000000000000000000000000000001466e099d640cde6de9d40ac749b4b594126b0169747122711109c9985d47751f93

-----Decoded View---------------
Arg [0] : _usdc (address): 0x2791bca1f2de4661ed88a30c99a7a9449aa84174
Arg [1] : _aPoolAddrProvider (address): 0xd05e3e715d945b59290df0ae8ef85c1bdb684744
Arg [2] : _aToken (address): 0x1a13f4ca1d028320a707d99520abfefca3998b7f
Arg [3] : vrfCoordinator (address): 0xae975071be8f8ee67addbc1a82488f1c24858067
Arg [4] : _link (address): 0xb0897686c545045afc77cf20ec7a532e3120e0f1
Arg [5] : _subscriptionId (uint64): 326
Arg [6] : _keyhash (bytes32): 0x6e099d640cde6de9d40ac749b4b594126b0169747122711109c9985d47751f93

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174
Arg [1] : 000000000000000000000000d05e3e715d945b59290df0ae8ef85c1bdb684744
Arg [2] : 0000000000000000000000001a13f4ca1d028320a707d99520abfefca3998b7f
Arg [3] : 000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067
Arg [4] : 000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000146
Arg [6] : 6e099d640cde6de9d40ac749b4b594126b0169747122711109c9985d47751f93


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.