Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x222a2EE4A8e587Ec0E9DA344dc095c1163daAd00
Balance 0 ETH
Nonce 1
Code Size 4158 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

4158 bytes
0x608060405234801561000f575f80fd5b5060043610610055575f3560e01c806385d2e82a1461005957806396afb36514610075578063bf5522da14610091578063cbc0c265146100c5578063fc0c546a146100e1575b5f80fd5b610073600480360381019061006e91906109ad565b6100ff565b005b61008f600480360381019061008a91906109fd565b6103f2565b005b6100ab60048036038101906100a691906109fd565b61064a565b6040516100bc959493929190610a90565b60405180910390f35b6100df60048036038101906100da9190610b0b565b6106a6565b005b6100e961091f565b6040516100f69190610bb6565b60405180910390f35b5f73ffffffffffffffffffffffffffffffffffffffff165f808581526020019081526020015f205f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461019e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019590610c29565b60405180910390fd5b67016345785d8a00008210156101e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e090610c91565b60405180910390fd5b42811161022b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161022290610cf9565b60405180910390fd5b7f000000000000000000000000d274084847eb88c8662552d18a1b2bfd3af152ca73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161028893929190610d17565b6020604051808303815f875af11580156102a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102c89190610d76565b506040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018381526020018281526020015f15158152505f808581526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015f6101000a81548160ff0219169083151502179055509050503373ffffffffffffffffffffffffffffffffffffffff16837f4980c1d8b44dabcbec98bf44453e93383858d593ac64dd7f7d2741b305bd675784846040516103e5929190610da1565b60405180910390a3505050565b5f805f8381526020019081526020015f2090503373ffffffffffffffffffffffffffffffffffffffff16815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610495576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048c90610e12565b60405180910390fd5b806004015f9054906101000a900460ff16156104e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104dd90610e7a565b60405180910390fd5b806003015442101561052d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052490610ee2565b60405180910390fd5b5f816002015490505f82600201819055506001826004015f6101000a81548160ff0219169083151502179055507f000000000000000000000000d274084847eb88c8662552d18a1b2bfd3af152ca73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016105b5929190610f00565b6020604051808303815f875af11580156105d1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105f59190610d76565b503373ffffffffffffffffffffffffffffffffffffffff16837fbb6fc58e80342b892c8b06eced40f8657651c237fd3ce1cc24c2b8a3d35f27708360405161063d9190610f27565b60405180910390a3505050565b5f602052805f5260405f205f91509050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002015490806003015490806004015f9054906101000a900460ff16905085565b5f805f8581526020019081526020015f2090503373ffffffffffffffffffffffffffffffffffffffff16815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610749576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074090610e12565b60405180910390fd5b806004015f9054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190610e7a565b60405180910390fd5b5f821180156107ad575080600201548211155b6107ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e390610f8a565b60405180910390fd5b81816002015f8282546107ff9190610fd5565b925050819055505f81600201540361082e576001816004015f6101000a81548160ff0219169083151502179055505b7f000000000000000000000000d274084847eb88c8662552d18a1b2bfd3af152ca73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401610889929190610f00565b6020604051808303815f875af11580156108a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108c99190610d76565b508273ffffffffffffffffffffffffffffffffffffffff16847f68b5621fc9973dcfde8c5b11ad3a1b8cc41b8b8a85e251b1da3d425ec965568d846040516109119190610f27565b60405180910390a350505050565b7f000000000000000000000000d274084847eb88c8662552d18a1b2bfd3af152ca81565b5f80fd5b5f819050919050565b61095981610947565b8114610963575f80fd5b50565b5f8135905061097481610950565b92915050565b5f819050919050565b61098c8161097a565b8114610996575f80fd5b50565b5f813590506109a781610983565b92915050565b5f805f606084860312156109c4576109c3610943565b5b5f6109d186828701610966565b93505060206109e286828701610999565b92505060406109f386828701610999565b9150509250925092565b5f60208284031215610a1257610a11610943565b5b5f610a1f84828501610966565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a5182610a28565b9050919050565b610a6181610a47565b82525050565b610a708161097a565b82525050565b5f8115159050919050565b610a8a81610a76565b82525050565b5f60a082019050610aa35f830188610a58565b610ab06020830187610a67565b610abd6040830186610a67565b610aca6060830185610a67565b610ad76080830184610a81565b9695505050505050565b610aea81610a47565b8114610af4575f80fd5b50565b5f81359050610b0581610ae1565b92915050565b5f805f60608486031215610b2257610b21610943565b5b5f610b2f86828701610966565b9350506020610b4086828701610af7565b9250506040610b5186828701610999565b9150509250925092565b5f819050919050565b5f610b7e610b79610b7484610a28565b610b5b565b610a28565b9050919050565b5f610b8f82610b64565b9050919050565b5f610ba082610b85565b9050919050565b610bb081610b96565b82525050565b5f602082019050610bc95f830184610ba7565b92915050565b5f82825260208201905092915050565b7f65786973747300000000000000000000000000000000000000000000000000005f82015250565b5f610c13600683610bcf565b9150610c1e82610bdf565b602082019050919050565b5f6020820190508181035f830152610c4081610c07565b9050919050565b7f6d696e20302e3120746f6b656e000000000000000000000000000000000000005f82015250565b5f610c7b600d83610bcf565b9150610c8682610c47565b602082019050919050565b5f6020820190508181035f830152610ca881610c6f565b9050919050565b7f66757475726520646561646c696e6500000000000000000000000000000000005f82015250565b5f610ce3600f83610bcf565b9150610cee82610caf565b602082019050919050565b5f6020820190508181035f830152610d1081610cd7565b9050919050565b5f606082019050610d2a5f830186610a58565b610d376020830185610a58565b610d446040830184610a67565b949350505050565b610d5581610a76565b8114610d5f575f80fd5b50565b5f81519050610d7081610d4c565b92915050565b5f60208284031215610d8b57610d8a610943565b5b5f610d9884828501610d62565b91505092915050565b5f604082019050610db45f830185610a67565b610dc16020830184610a67565b9392505050565b7f6e6f742063726561746f720000000000000000000000000000000000000000005f82015250565b5f610dfc600b83610bcf565b9150610e0782610dc8565b602082019050919050565b5f6020820190508181035f830152610e2981610df0565b9050919050565b7f636c6f73656400000000000000000000000000000000000000000000000000005f82015250565b5f610e64600683610bcf565b9150610e6f82610e30565b602082019050919050565b5f6020820190508181035f830152610e9181610e58565b9050919050565b7f746f6f206561726c7900000000000000000000000000000000000000000000005f82015250565b5f610ecc600983610bcf565b9150610ed782610e98565b602082019050919050565b5f6020820190508181035f830152610ef981610ec0565b9050919050565b5f604082019050610f135f830185610a58565b610f206020830184610a67565b9392505050565b5f602082019050610f3a5f830184610a67565b92915050565b7f62616420616d6f756e74000000000000000000000000000000000000000000005f82015250565b5f610f74600a83610bcf565b9150610f7f82610f40565b602082019050919050565b5f6020820190508181035f830152610fa181610f68565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610fdf8261097a565b9150610fea8361097a565b925082820390508181111561100257611001610fa8565b5b9291505056fea26469706673582212201cc3be7154beaf66a21069cc67996d24790ead5dab07e99ca1576ff752ec908b64736f6c63430008180033

Verified Source Code Full Match

Compiler: v0.8.24+commit.e11b9ed9 EVM: shanghai Optimization: No
BountyEscrow.sol 66 lines
// SPDX-License-Identifier: MIT
  pragma solidity ^0.8.20;

  interface IERC20 {
      function transferFrom(address from, address to, uint256 amount) external returns
   (bool);
      function transfer(address to, uint256 amount) external returns (bool);
  }

  contract BountyEscrow {
      IERC20 public immutable token;

      struct Bounty {
          address creator;
          uint256 totalAmount;
          uint256 remaining;
          uint256 deadline;
          bool closed;
      }

      mapping(bytes32 => Bounty) public bounties;

      event BountyCreated(bytes32 indexed bountyId, address indexed creator, uint256
  amount, uint256 deadline);
      event BountyAwarded(bytes32 indexed bountyId, address indexed recipient, uint256
   amount);
      event BountyReclaimed(bytes32 indexed bountyId, address indexed creator, uint256
   amount);

      constructor(address _token) {
          token = IERC20(_token);
      }

      function createBounty(bytes32 bountyId, uint256 amount, uint256 deadline)
  external {
          require(bounties[bountyId].creator == address(0), "exists");
          require(amount >= 1e17, "min 0.1 token");
          require(deadline > block.timestamp, "future deadline");
          token.transferFrom(msg.sender, address(this), amount);
          bounties[bountyId] = Bounty(msg.sender, amount, amount, deadline, false);
          emit BountyCreated(bountyId, msg.sender, amount, deadline);
      }

      function award(bytes32 bountyId, address recipient, uint256 amount) external {
          Bounty storage b = bounties[bountyId];
          require(b.creator == msg.sender, "not creator");
          require(!b.closed, "closed");
          require(amount > 0 && amount <= b.remaining, "bad amount");
          b.remaining -= amount;
          if (b.remaining == 0) b.closed = true;
          token.transfer(recipient, amount);
          emit BountyAwarded(bountyId, recipient, amount);
      }

      function reclaim(bytes32 bountyId) external {
          Bounty storage b = bounties[bountyId];
          require(b.creator == msg.sender, "not creator");
          require(!b.closed, "closed");
          require(block.timestamp >= b.deadline, "too early");
          uint256 amt = b.remaining;
          b.remaining = 0;
          b.closed = true;
          token.transfer(msg.sender, amt);
          emit BountyReclaimed(bountyId, msg.sender, amt);
      }
  }

Read Contract

bounties 0xbf5522da → address, uint256, uint256, uint256, bool
token 0xfc0c546a → address

Write Contract 3 functions

These functions modify contract state and require a wallet transaction to execute.

award 0xcbc0c265
bytes32 bountyId
address recipient
uint256 amount
createBounty 0x85d2e82a
bytes32 bountyId
uint256 amount
uint256 deadline
reclaim 0x96afb365
bytes32 bountyId

Recent Transactions

No transactions found for this address