Source Code
Latest 9 from a total of 9 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Create Deposit | 31199023 | 23 hrs ago | IN | 0 FRAX | 0.00000855 | ||||
| Create Deposit | 31198984 | 23 hrs ago | IN | 0 FRAX | 0.00000855 | ||||
| Create Deposit | 30765807 | 11 days ago | IN | 0 FRAX | 0.00000742 | ||||
| Withdraw | 30764856 | 11 days ago | IN | 0 FRAX | 0.00000639 | ||||
| Create Deposit | 30764838 | 11 days ago | IN | 0 FRAX | 0.00000464 | ||||
| Withdraw | 30764694 | 11 days ago | IN | 0 FRAX | 0.00000745 | ||||
| Create Deposit | 30764664 | 11 days ago | IN | 0 FRAX | 0.00000548 | ||||
| Create Deposit | 30764566 | 11 days ago | IN | 0 FRAX | 0.00000624 | ||||
| Create Deposit | 30764548 | 11 days ago | IN | 0 FRAX | 0.00000624 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers.
Latest 9 internal transactions
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BearerGenerator
Compiler Version
v0.8.30+commit.73712a01
Optimization Enabled:
No with 200 runs
Other Settings:
prague EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract BearerGenerator {
struct Deposit {
address token;
uint256 amount;
bool claimed;
}
// Hash of secret -> Deposit details
mapping(bytes32 => Deposit) public deposits;
event DepositCreated(bytes32 indexed secretHash, address token, uint256 amount);
event Withdrawn(bytes32 indexed secretHash, address recipient);
function createDeposit(address token, uint256 amount, bytes32 secretHash) external {
if (deposits[secretHash].amount != 0) revert SecretUsed();
if (amount == 0) revert MustBeGt0();
IERC20(token).transferFrom(msg.sender, address(this), amount);
deposits[secretHash] = Deposit({ token: token, amount: amount, claimed: false });
emit DepositCreated(secretHash, token, amount);
}
function withdraw(string calldata secret, address recipient) external {
bytes32 secretHash = keccak256(abi.encodePacked(secret));
Deposit storage deposit = deposits[secretHash];
if (deposit.amount == 0) revert DepositDoesNotExist();
if (deposit.claimed) revert AlreadyClaimed();
deposit.claimed = true;
IERC20(deposit.token).transfer(recipient, deposit.amount);
emit Withdrawn(secretHash, recipient);
}
function checkDeposit(bytes32 secretHash) external view returns (address token, uint256 amount, bool claimed) {
Deposit memory deposit = deposits[secretHash];
return (deposit.token, deposit.amount, deposit.claimed);
}
error DepositDoesNotExist();
error AlreadyClaimed();
error SecretUsed();
error MustBeGt0();
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}{
"remappings": [
"frax-std/=node_modules/frax-standard-solidity/src/",
"forge-std/=node_modules/forge-std/src/",
"ds-test/=node_modules/ds-test/src/",
"@openzeppelin/=node_modules/@openzeppelin/"
],
"optimizer": {
"enabled": false,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "prague",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"DepositDoesNotExist","type":"error"},{"inputs":[],"name":"MustBeGt0","type":"error"},{"inputs":[],"name":"SecretUsed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"secretHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"secretHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"bytes32","name":"secretHash","type":"bytes32"}],"name":"checkDeposit","outputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claimed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"secretHash","type":"bytes32"}],"name":"createDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"deposits","outputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claimed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"secret","type":"string"},{"internalType":"address","name":"recipient","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080604052348015600e575f5ffd5b506109678061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061004a575f3560e01c80633d4dff7b1461004e5780636849a33114610080578063c1ce5db5146100b2578063dd48622e146100ce575b5f5ffd5b610068600480360381019061006391906105e0565b6100ea565b6040516100779392919061067c565b60405180910390f35b61009a600480360381019061009591906105e0565b61013a565b6040516100a99392919061067c565b60405180910390f35b6100cc60048036038101906100c79190610705565b6101ef565b005b6100e860048036038101906100e391906107b6565b6103e4565b005b5f602052805f5260405f205f91509050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002015f9054906101000a900460ff16905083565b5f5f5f5f5f5f8681526020019081526020015f206040518060600160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015f9054906101000a900460ff1615151515815250509050805f015181602001518260400151935093509350509193909250565b5f5f5f8381526020019081526020015f20600101541461023b576040517f6ca4dbe200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8203610274576040517fc9935ff900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016102b193929190610813565b6020604051808303815f875af11580156102cd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102f19190610872565b5060405180606001604052808473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020015f15158152505f5f8381526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015f6101000a81548160ff021916908315150217905550905050807f2fc7f61216f4b9da63724a7ccba484452205b7cf651334640e3cd1120178600684846040516103d792919061089d565b60405180910390a2505050565b5f83836040516020016103f8929190610900565b6040516020818303038152906040528051906020012090505f5f5f8381526020019081526020015f2090505f816001015403610460576040517fc7c9660f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806002015f9054906101000a900460ff16156104a8576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001816002015f6101000a81548160ff021916908315150217905550805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8483600101546040518363ffffffff1660e01b815260040161052592919061089d565b6020604051808303815f875af1158015610541573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105659190610872565b50817ff0d0864583a8231b5ff3c9d26b03e84a32b52495111e31e44d49e43a492dc7b2846040516105969190610918565b60405180910390a25050505050565b5f5ffd5b5f5ffd5b5f819050919050565b6105bf816105ad565b81146105c9575f5ffd5b50565b5f813590506105da816105b6565b92915050565b5f602082840312156105f5576105f46105a5565b5b5f610602848285016105cc565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6106348261060b565b9050919050565b6106448161062a565b82525050565b5f819050919050565b61065c8161064a565b82525050565b5f8115159050919050565b61067681610662565b82525050565b5f60608201905061068f5f83018661063b565b61069c6020830185610653565b6106a9604083018461066d565b949350505050565b6106ba8161062a565b81146106c4575f5ffd5b50565b5f813590506106d5816106b1565b92915050565b6106e48161064a565b81146106ee575f5ffd5b50565b5f813590506106ff816106db565b92915050565b5f5f5f6060848603121561071c5761071b6105a5565b5b5f610729868287016106c7565b935050602061073a868287016106f1565b925050604061074b868287016105cc565b9150509250925092565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f84011261077657610775610755565b5b8235905067ffffffffffffffff81111561079357610792610759565b5b6020830191508360018202830111156107af576107ae61075d565b5b9250929050565b5f5f5f604084860312156107cd576107cc6105a5565b5b5f84013567ffffffffffffffff8111156107ea576107e96105a9565b5b6107f686828701610761565b93509350506020610809868287016106c7565b9150509250925092565b5f6060820190506108265f83018661063b565b610833602083018561063b565b6108406040830184610653565b949350505050565b61085181610662565b811461085b575f5ffd5b50565b5f8151905061086c81610848565b92915050565b5f60208284031215610887576108866105a5565b5b5f6108948482850161085e565b91505092915050565b5f6040820190506108b05f83018561063b565b6108bd6020830184610653565b9392505050565b5f81905092915050565b828183375f83830152505050565b5f6108e783856108c4565b93506108f48385846108ce565b82840190509392505050565b5f61090c8284866108dc565b91508190509392505050565b5f60208201905061092b5f83018461063b565b9291505056fea2646970667358221220884f5ae69bdcd27fc849fdcc4576069fcf6f86c5cf9f4d82c0e788c6834e9a2564736f6c634300081e0033
Deployed Bytecode
0x608060405234801561000f575f5ffd5b506004361061004a575f3560e01c80633d4dff7b1461004e5780636849a33114610080578063c1ce5db5146100b2578063dd48622e146100ce575b5f5ffd5b610068600480360381019061006391906105e0565b6100ea565b6040516100779392919061067c565b60405180910390f35b61009a600480360381019061009591906105e0565b61013a565b6040516100a99392919061067c565b60405180910390f35b6100cc60048036038101906100c79190610705565b6101ef565b005b6100e860048036038101906100e391906107b6565b6103e4565b005b5f602052805f5260405f205f91509050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002015f9054906101000a900460ff16905083565b5f5f5f5f5f5f8681526020019081526020015f206040518060600160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015f9054906101000a900460ff1615151515815250509050805f015181602001518260400151935093509350509193909250565b5f5f5f8381526020019081526020015f20600101541461023b576040517f6ca4dbe200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8203610274576040517fc9935ff900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016102b193929190610813565b6020604051808303815f875af11580156102cd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102f19190610872565b5060405180606001604052808473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020015f15158152505f5f8381526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015f6101000a81548160ff021916908315150217905550905050807f2fc7f61216f4b9da63724a7ccba484452205b7cf651334640e3cd1120178600684846040516103d792919061089d565b60405180910390a2505050565b5f83836040516020016103f8929190610900565b6040516020818303038152906040528051906020012090505f5f5f8381526020019081526020015f2090505f816001015403610460576040517fc7c9660f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806002015f9054906101000a900460ff16156104a8576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001816002015f6101000a81548160ff021916908315150217905550805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8483600101546040518363ffffffff1660e01b815260040161052592919061089d565b6020604051808303815f875af1158015610541573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105659190610872565b50817ff0d0864583a8231b5ff3c9d26b03e84a32b52495111e31e44d49e43a492dc7b2846040516105969190610918565b60405180910390a25050505050565b5f5ffd5b5f5ffd5b5f819050919050565b6105bf816105ad565b81146105c9575f5ffd5b50565b5f813590506105da816105b6565b92915050565b5f602082840312156105f5576105f46105a5565b5b5f610602848285016105cc565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6106348261060b565b9050919050565b6106448161062a565b82525050565b5f819050919050565b61065c8161064a565b82525050565b5f8115159050919050565b61067681610662565b82525050565b5f60608201905061068f5f83018661063b565b61069c6020830185610653565b6106a9604083018461066d565b949350505050565b6106ba8161062a565b81146106c4575f5ffd5b50565b5f813590506106d5816106b1565b92915050565b6106e48161064a565b81146106ee575f5ffd5b50565b5f813590506106ff816106db565b92915050565b5f5f5f6060848603121561071c5761071b6105a5565b5b5f610729868287016106c7565b935050602061073a868287016106f1565b925050604061074b868287016105cc565b9150509250925092565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f84011261077657610775610755565b5b8235905067ffffffffffffffff81111561079357610792610759565b5b6020830191508360018202830111156107af576107ae61075d565b5b9250929050565b5f5f5f604084860312156107cd576107cc6105a5565b5b5f84013567ffffffffffffffff8111156107ea576107e96105a9565b5b6107f686828701610761565b93509350506020610809868287016106c7565b9150509250925092565b5f6060820190506108265f83018661063b565b610833602083018561063b565b6108406040830184610653565b949350505050565b61085181610662565b811461085b575f5ffd5b50565b5f8151905061086c81610848565b92915050565b5f60208284031215610887576108866105a5565b5b5f6108948482850161085e565b91505092915050565b5f6040820190506108b05f83018561063b565b6108bd6020830184610653565b9392505050565b5f81905092915050565b828183375f83830152505050565b5f6108e783856108c4565b93506108f48385846108ce565b82840190509392505050565b5f61090c8284866108dc565b91508190509392505050565b5f60208201905061092b5f83018461063b565b9291505056fea2646970667358221220884f5ae69bdcd27fc849fdcc4576069fcf6f86c5cf9f4d82c0e788c6834e9a2564736f6c634300081e0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$3.00
Net Worth in FRAX
2.898479
Token Allocations
FRXUSD
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| FRAXTAL | 100.00% | $0.999433 | 3 | $3 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.