ETH Price: $3,002.25 (-6.57%)
Gas: 12 Gwei

Contract

0xC7D5E6FA4D5B4b4A82b14a256008DAfAF5232ADb
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Swap Exact Dola ...196394142024-04-12 12:05:3537 hrs ago1712923535IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0016225118.12544597
Swap Exact Dola ...195575162024-04-01 0:45:4713 days ago1711932347IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0020519119.67205288
Swap Exact Dola ...194504292024-03-16 22:30:2328 days ago1710628223IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0030083433.60338726
Swap Exact Dola ...194502082024-03-16 21:45:3528 days ago1710625535IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0031391935.06111573
Swap Exact Dola ...194492052024-03-16 18:22:5928 days ago1710613379IN
0xC7D5E6FA...AF5232ADb
0 ETH0.006622772
Swap Exact Dola ...194491842024-03-16 18:18:4728 days ago1710613127IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0033475837.38859398
Swap Exact Dola ...194491722024-03-16 18:16:1128 days ago1710612971IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0036309140.56167009
Swap Dola For Ex...194486342024-03-16 16:27:4728 days ago1710606467IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0028777631.29438184
Swap Exact Dola ...193948792024-03-09 3:32:3535 days ago1709955155IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0042100745.75868632
Swap Exact Dola ...193947392024-03-09 3:04:3535 days ago1709953475IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0041867146.75600076
Swap Exact Dola ...193941792024-03-09 1:12:1136 days ago1709946731IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0041000444.57445583
Swap Exact Dola ...193939432024-03-09 0:24:4736 days ago1709943887IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0044029447.86121443
Swap Exact Dola ...193937932024-03-08 23:54:1136 days ago1709942051IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0042386446.08128251
Swap Exact Dola ...193935912024-03-08 23:12:1136 days ago1709939531IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0050838156.77453021
Swap Exact Dola ...193934772024-03-08 22:48:2336 days ago1709938103IN
0xC7D5E6FA...AF5232ADb
0 ETH0.005294959.15036577
Swap Exact Dola ...192942312024-02-24 1:42:1150 days ago1708738931IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0020872823.31512546
Swap Exact Dola ...191722642024-02-06 22:49:3567 days ago1707259775IN
0xC7D5E6FA...AF5232ADb
0 ETH0.002131623.81018274
Swap Exact Dola ...191722232024-02-06 22:41:1167 days ago1707259271IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0022566325.20679432
Swap Exact Dola ...191722122024-02-06 22:38:5967 days ago1707259139IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0021652424.18320863
Swap Exact Dola ...191721872024-02-06 22:33:4767 days ago1707258827IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0022610225.2558431
Swap Exact Dola ...191608782024-02-05 8:26:3568 days ago1707121595IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0011741812.76367328
Swap Exact Dola ...191555032024-02-04 14:20:3569 days ago1707056435IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0015673116.97510441
Swap Exact Dola ...191493502024-02-03 17:35:3570 days ago1706981735IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0015909817.23154352
Swap Exact Dola ...190141122024-01-15 18:36:3589 days ago1705343795IN
0xC7D5E6FA...AF5232ADb
0 ETH0.0037076133.99302856
0x60c06040189404872024-01-05 10:29:4799 days ago1704450587IN
 Create: Helper
0 ETH0.0083357216.87574536

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Helper

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 1 : Helper.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.21;

interface IAuction {
    function getCurrentReserves() external view returns (uint dolaReserve, uint dbrReserve);
    function buyDBR(uint exactDolaIn, uint exactDbrOut, address to) external;
}

interface IERC20 {
    function approve(address,uint) external returns (bool);
    function transferFrom(address,address,uint) external returns (bool);
}

contract Helper {

    IAuction public immutable auction;
    IERC20 public immutable dola;

    constructor(
        address _auction,
        address _dola
    ) {
        auction = IAuction(_auction);
        dola = IERC20(_dola);
        dola.approve(_auction, type(uint).max);
    }
    
    function getDbrOut(uint dolaIn) public view returns (uint dbrOut) {
        require(dolaIn > 0, "dolaIn must be positive");
        (uint dolaReserve, uint dbrReserve) = auction.getCurrentReserves();
        uint numerator = dolaIn * dbrReserve;
        uint denominator = dolaReserve + dolaIn;
        dbrOut = numerator / denominator;
    }

    function getDolaIn(uint dbrOut) public view returns (uint dolaIn) {
        require(dbrOut > 0, "dbrOut must be positive");
        (uint dolaReserve, uint dbrReserve) = auction.getCurrentReserves();
        uint numerator = dbrOut * dolaReserve;
        uint denominator = dbrReserve - dbrOut;
        dolaIn = (numerator / denominator) + 1;
    }

    function swapExactDolaForDbr(uint dolaIn, uint dbrOutMin) external returns (uint dbrOut) {
        dbrOut = getDbrOut(dolaIn);
        require(dbrOut >= dbrOutMin, "dbrOut must be greater than dbrOutMin");
        dola.transferFrom(msg.sender, address(this), dolaIn);
        auction.buyDBR(dolaIn, dbrOut, msg.sender);
    }

    function swapDolaForExactDbr(uint dbrOut, uint dolaInMax) external returns (uint dolaIn) {
        dolaIn = getDolaIn(dbrOut);
        require(dolaIn <= dolaInMax, "dolaIn must be less than dolaInMax");
        dola.transferFrom(msg.sender, address(this), dolaIn);
        auction.buyDBR(dolaIn, dbrOut, msg.sender);
    }

}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_auction","type":"address"},{"internalType":"address","name":"_dola","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"auction","outputs":[{"internalType":"contract IAuction","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dola","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dolaIn","type":"uint256"}],"name":"getDbrOut","outputs":[{"internalType":"uint256","name":"dbrOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dbrOut","type":"uint256"}],"name":"getDolaIn","outputs":[{"internalType":"uint256","name":"dolaIn","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dbrOut","type":"uint256"},{"internalType":"uint256","name":"dolaInMax","type":"uint256"}],"name":"swapDolaForExactDbr","outputs":[{"internalType":"uint256","name":"dolaIn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"dolaIn","type":"uint256"},{"internalType":"uint256","name":"dbrOutMin","type":"uint256"}],"name":"swapExactDolaForDbr","outputs":[{"internalType":"uint256","name":"dbrOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

60c060405234801561001057600080fd5b506040516108e83803806108e883398101604081905261002f916100d5565b6001600160a01b03828116608081905290821660a081905260405163095ea7b360e01b8152600481019290925260001960248301529063095ea7b3906044016020604051808303816000875af115801561008d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b19190610108565b505050610131565b80516001600160a01b03811681146100d057600080fd5b919050565b600080604083850312156100e857600080fd5b6100f1836100b9565b91506100ff602084016100b9565b90509250929050565b60006020828403121561011a57600080fd5b8151801515811461012a57600080fd5b9392505050565b60805160a05161076a61017e6000396000818160e4015281816101bb0152610561015260008181606c01528181610254015281816103150152818161042a01526105fa015261076a6000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80637d9f6db514610067578063a1d33b4a146100ab578063d18bdaad146100cc578063ea0593e4146100df578063f002a44814610106578063f2f5b5f714610119575b600080fd5b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100be6100b9366004610631565b61012c565b6040519081526020016100a2565b6100be6100da366004610653565b6102bf565b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6100be610114366004610653565b6103d4565b6100be610127366004610631565b6104d4565b6000610137836102bf565b9050818111156101995760405162461bcd60e51b815260206004820152602260248201527f646f6c61496e206d757374206265206c657373207468616e20646f6c61496e4d6044820152610c2f60f31b60648201526084015b60405180910390fd5b6040516323b872dd60e01b8152336004820152306024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af115801561020c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610230919061066c565b5060405163591d6f5360e11b815260048101829052602481018490523360448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b23adea6906064015b600060405180830381600087803b1580156102a157600080fd5b505af11580156102b5573d6000803e3d6000fd5b5050505092915050565b60008082116103105760405162461bcd60e51b815260206004820152601760248201527f6462724f7574206d75737420626520706f7369746976650000000000000000006044820152606401610190565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166354901c386040518163ffffffff1660e01b81526004016040805180830381865afa158015610370573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103949190610695565b909250905060006103a583866106cf565b905060006103b386846106ec565b90506103bf81836106ff565b6103ca906001610721565b9695505050505050565b60008082116104255760405162461bcd60e51b815260206004820152601760248201527f646f6c61496e206d75737420626520706f7369746976650000000000000000006044820152606401610190565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166354901c386040518163ffffffff1660e01b81526004016040805180830381865afa158015610485573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a99190610695565b909250905060006104ba82866106cf565b905060006104c88685610721565b90506103ca81836106ff565b60006104df836103d4565b90508181101561053f5760405162461bcd60e51b815260206004820152602560248201527f6462724f7574206d7573742062652067726561746572207468616e206462724f6044820152643aba26b4b760d91b6064820152608401610190565b6040516323b872dd60e01b8152336004820152306024820152604481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af11580156105b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d6919061066c565b5060405163591d6f5360e11b815260048101849052602481018290523360448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b23adea690606401610287565b6000806040838503121561064457600080fd5b50508035926020909101359150565b60006020828403121561066557600080fd5b5035919050565b60006020828403121561067e57600080fd5b8151801515811461068e57600080fd5b9392505050565b600080604083850312156106a857600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176106e6576106e66106b9565b92915050565b818103818111156106e6576106e66106b9565b60008261071c57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156106e6576106e66106b956fea2646970667358221220059ddf3502d0413ed44e7b5cca663834dcc4ab280e730eaa9a9141e79870d8f764736f6c63430008150033000000000000000000000000933cbe81313d9dd523df6dc9b899a7af8ba073e3000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c80637d9f6db514610067578063a1d33b4a146100ab578063d18bdaad146100cc578063ea0593e4146100df578063f002a44814610106578063f2f5b5f714610119575b600080fd5b61008e7f000000000000000000000000933cbe81313d9dd523df6dc9b899a7af8ba073e381565b6040516001600160a01b0390911681526020015b60405180910390f35b6100be6100b9366004610631565b61012c565b6040519081526020016100a2565b6100be6100da366004610653565b6102bf565b61008e7f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce481565b6100be610114366004610653565b6103d4565b6100be610127366004610631565b6104d4565b6000610137836102bf565b9050818111156101995760405162461bcd60e51b815260206004820152602260248201527f646f6c61496e206d757374206265206c657373207468616e20646f6c61496e4d6044820152610c2f60f31b60648201526084015b60405180910390fd5b6040516323b872dd60e01b8152336004820152306024820152604481018290527f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce46001600160a01b0316906323b872dd906064016020604051808303816000875af115801561020c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610230919061066c565b5060405163591d6f5360e11b815260048101829052602481018490523360448201527f000000000000000000000000933cbe81313d9dd523df6dc9b899a7af8ba073e36001600160a01b03169063b23adea6906064015b600060405180830381600087803b1580156102a157600080fd5b505af11580156102b5573d6000803e3d6000fd5b5050505092915050565b60008082116103105760405162461bcd60e51b815260206004820152601760248201527f6462724f7574206d75737420626520706f7369746976650000000000000000006044820152606401610190565b6000807f000000000000000000000000933cbe81313d9dd523df6dc9b899a7af8ba073e36001600160a01b03166354901c386040518163ffffffff1660e01b81526004016040805180830381865afa158015610370573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103949190610695565b909250905060006103a583866106cf565b905060006103b386846106ec565b90506103bf81836106ff565b6103ca906001610721565b9695505050505050565b60008082116104255760405162461bcd60e51b815260206004820152601760248201527f646f6c61496e206d75737420626520706f7369746976650000000000000000006044820152606401610190565b6000807f000000000000000000000000933cbe81313d9dd523df6dc9b899a7af8ba073e36001600160a01b03166354901c386040518163ffffffff1660e01b81526004016040805180830381865afa158015610485573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a99190610695565b909250905060006104ba82866106cf565b905060006104c88685610721565b90506103ca81836106ff565b60006104df836103d4565b90508181101561053f5760405162461bcd60e51b815260206004820152602560248201527f6462724f7574206d7573742062652067726561746572207468616e206462724f6044820152643aba26b4b760d91b6064820152608401610190565b6040516323b872dd60e01b8152336004820152306024820152604481018490527f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce46001600160a01b0316906323b872dd906064016020604051808303816000875af11580156105b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d6919061066c565b5060405163591d6f5360e11b815260048101849052602481018290523360448201527f000000000000000000000000933cbe81313d9dd523df6dc9b899a7af8ba073e36001600160a01b03169063b23adea690606401610287565b6000806040838503121561064457600080fd5b50508035926020909101359150565b60006020828403121561066557600080fd5b5035919050565b60006020828403121561067e57600080fd5b8151801515811461068e57600080fd5b9392505050565b600080604083850312156106a857600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176106e6576106e66106b9565b92915050565b818103818111156106e6576106e66106b9565b60008261071c57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156106e6576106e66106b956fea2646970667358221220059ddf3502d0413ed44e7b5cca663834dcc4ab280e730eaa9a9141e79870d8f764736f6c63430008150033

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

000000000000000000000000933cbe81313d9dd523df6dc9b899a7af8ba073e3000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4

-----Decoded View---------------
Arg [0] : _auction (address): 0x933cBE81313d9dD523dF6dC9B899A7AF8Ba073e3
Arg [1] : _dola (address): 0x865377367054516e17014CcdED1e7d814EDC9ce4

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000933cbe81313d9dd523df6dc9b899a7af8ba073e3
Arg [1] : 000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4


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

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.