Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 364,593 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Submit Data Paym... | 107689946 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689940 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689904 | 127 days ago | IN | 0 ETH | 0.00000748 | ||||
Submit Data Paym... | 107689893 | 127 days ago | IN | 0 ETH | 0.00000747 | ||||
Submit Data Paym... | 107689864 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689853 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689822 | 127 days ago | IN | 0 ETH | 0.00000748 | ||||
Submit Data Paym... | 107689812 | 127 days ago | IN | 0 ETH | 0.00000748 | ||||
Submit Data Paym... | 107689785 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689776 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689742 | 127 days ago | IN | 0 ETH | 0.00000747 | ||||
Submit Data Paym... | 107689735 | 127 days ago | IN | 0 ETH | 0.00000748 | ||||
Submit Data Paym... | 107689701 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689696 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689659 | 127 days ago | IN | 0 ETH | 0.00000748 | ||||
Submit Data Paym... | 107689654 | 127 days ago | IN | 0 ETH | 0.00000747 | ||||
Submit Data Paym... | 107689618 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689615 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689577 | 127 days ago | IN | 0 ETH | 0.00000748 | ||||
Submit Data Paym... | 107689574 | 127 days ago | IN | 0 ETH | 0.00000747 | ||||
Submit Data Paym... | 107689538 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689533 | 127 days ago | IN | 0 ETH | 0.00000856 | ||||
Submit Data Paym... | 107689496 | 127 days ago | IN | 0 ETH | 0.00000747 | ||||
Submit Data Paym... | 107689490 | 127 days ago | IN | 0 ETH | 0.00000748 | ||||
Submit Data Paym... | 107689454 | 127 days ago | IN | 0 ETH | 0.00000856 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
DataPayments
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract DataPayments { address public immutable PAYMENT_TOKEN_ADDRESS; struct DataPayment { address rewardsAddress; uint256 amount; bytes32 quoteHash; } event DataPaymentMade( address indexed rewardsAddress, uint256 indexed amount, bytes32 indexed quoteHash ); constructor(address _tokenAddress) { require(_tokenAddress != address(0), "Token address cannot be zero address"); PAYMENT_TOKEN_ADDRESS = _tokenAddress; } function submitDataPayments(DataPayment[] calldata dataPayments) external { for (uint256 i = 0; i < dataPayments.length; i++) { DataPayment calldata dataPayment = dataPayments[i]; // Send tokens to the reward address _sendTokens(msg.sender, dataPayment.rewardsAddress, dataPayment.amount); // Emit events that can be listened to and will be stored in the transaction emit DataPaymentMade(dataPayment.rewardsAddress, dataPayment.amount, dataPayment.quoteHash); } } function _sendTokens(address from, address to, uint256 amount) internal { require(IERC20(PAYMENT_TOKEN_ADDRESS).balanceOf(from) >= amount, "Wallet does not have enough tokens"); if (from != address(this)) { require(IERC20(PAYMENT_TOKEN_ADDRESS).allowance(from, address(this)) >= amount, "Contract is not allowed to spend enough tokens"); } IERC20(PAYMENT_TOKEN_ADDRESS).transferFrom(from, to, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rewardsAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"quoteHash","type":"bytes32"}],"name":"DataPaymentMade","type":"event"},{"inputs":[],"name":"PAYMENT_TOKEN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"rewardsAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"quoteHash","type":"bytes32"}],"internalType":"struct DataPayments.DataPayment[]","name":"dataPayments","type":"tuple[]"}],"name":"submitDataPayments","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b506040516105f73803806105f783398101604081905261002f916100a6565b6001600160a01b0381166100955760405162461bcd60e51b8152602060048201526024808201527f546f6b656e20616464726573732063616e6e6f74206265207a65726f206164646044820152637265737360e01b606482015260840160405180910390fd5b6001600160a01b03166080526100d6565b6000602082840312156100b857600080fd5b81516001600160a01b03811681146100cf57600080fd5b9392505050565b6080516104f26101056000396000818160400152818161015101528181610253015261035301526104f26000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80635c0d32861461003b578063dee1dfa01461007e575b600080fd5b6100627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b61009161008c3660046103c6565b610093565b005b60005b8181101561012b57368383838181106100b1576100b161043b565b6060029190910191506100d79050336100cd6020840184610451565b8360200135610130565b6040810135602082018035906100ed9084610451565b6001600160a01b03167ff998960b1c6f0e0e89b7bbe6b6fbf3e03e6f08eee5b8430877d8adb8e149d58060405160405180910390a450600101610096565b505050565b6040516370a0823160e01b81526001600160a01b03848116600483015282917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa15801561019a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101be9190610481565b101561021c5760405162461bcd60e51b815260206004820152602260248201527f57616c6c657420646f6573206e6f74206861766520656e6f75676820746f6b656044820152616e7360f01b60648201526084015b60405180910390fd5b6001600160a01b038316301461032557604051636eb1769f60e11b81526001600160a01b03848116600483015230602483015282917f00000000000000000000000000000000000000000000000000000000000000009091169063dd62ed3e90604401602060405180830381865afa15801561029c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c09190610481565b10156103255760405162461bcd60e51b815260206004820152602e60248201527f436f6e7472616374206973206e6f7420616c6c6f77656420746f207370656e6460448201526d20656e6f75676820746f6b656e7360901b6064820152608401610213565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af115801561039c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c0919061049a565b50505050565b600080602083850312156103d957600080fd5b823567ffffffffffffffff808211156103f157600080fd5b818501915085601f83011261040557600080fd5b81358181111561041457600080fd5b86602060608302850101111561042957600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561046357600080fd5b81356001600160a01b038116811461047a57600080fd5b9392505050565b60006020828403121561049357600080fd5b5051919050565b6000602082840312156104ac57600080fd5b8151801515811461047a57600080fdfea26469706673582212206f3a305284dc687832455d7d49b202dcf22b32d76aff5ccd14c3c8539596bcf464736f6c634300081800330000000000000000000000004bc1ace0e66170375462cb4e6af42ad4d5ec689c
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80635c0d32861461003b578063dee1dfa01461007e575b600080fd5b6100627f0000000000000000000000004bc1ace0e66170375462cb4e6af42ad4d5ec689c81565b6040516001600160a01b03909116815260200160405180910390f35b61009161008c3660046103c6565b610093565b005b60005b8181101561012b57368383838181106100b1576100b161043b565b6060029190910191506100d79050336100cd6020840184610451565b8360200135610130565b6040810135602082018035906100ed9084610451565b6001600160a01b03167ff998960b1c6f0e0e89b7bbe6b6fbf3e03e6f08eee5b8430877d8adb8e149d58060405160405180910390a450600101610096565b505050565b6040516370a0823160e01b81526001600160a01b03848116600483015282917f0000000000000000000000004bc1ace0e66170375462cb4e6af42ad4d5ec689c909116906370a0823190602401602060405180830381865afa15801561019a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101be9190610481565b101561021c5760405162461bcd60e51b815260206004820152602260248201527f57616c6c657420646f6573206e6f74206861766520656e6f75676820746f6b656044820152616e7360f01b60648201526084015b60405180910390fd5b6001600160a01b038316301461032557604051636eb1769f60e11b81526001600160a01b03848116600483015230602483015282917f0000000000000000000000004bc1ace0e66170375462cb4e6af42ad4d5ec689c9091169063dd62ed3e90604401602060405180830381865afa15801561029c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c09190610481565b10156103255760405162461bcd60e51b815260206004820152602e60248201527f436f6e7472616374206973206e6f7420616c6c6f77656420746f207370656e6460448201526d20656e6f75676820746f6b656e7360901b6064820152608401610213565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390527f0000000000000000000000004bc1ace0e66170375462cb4e6af42ad4d5ec689c16906323b872dd906064016020604051808303816000875af115801561039c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c0919061049a565b50505050565b600080602083850312156103d957600080fd5b823567ffffffffffffffff808211156103f157600080fd5b818501915085601f83011261040557600080fd5b81358181111561041457600080fd5b86602060608302850101111561042957600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561046357600080fd5b81356001600160a01b038116811461047a57600080fd5b9392505050565b60006020828403121561049357600080fd5b5051919050565b6000602082840312156104ac57600080fd5b8151801515811461047a57600080fdfea26469706673582212206f3a305284dc687832455d7d49b202dcf22b32d76aff5ccd14c3c8539596bcf464736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004bc1ace0e66170375462cb4e6af42ad4d5ec689c
-----Decoded View---------------
Arg [0] : _tokenAddress (address): 0x4bc1aCE0E66170375462cB4E6Af42Ad4D5EC689C
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000004bc1ace0e66170375462cb4e6af42ad4d5ec689c
Loading...
Loading
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.