Address Contract Partially Verified
Address
0xE58997B72cf7115701FC3302F36D38670924006B
Balance
1.8590 ETH
Nonce
1
Code Size
1918 bytes
Creator
0x6dd31a52...148e at tx 0x7373d551...093c93
Indexed Transactions
0
Contract Bytecode
1918 bytes
0x6080604052600436106100ab5760003560e01c80638456cb59116100645780638456cb591461016a578063897b06371461017f5780638da5cb5b1461019f5780639b2cb5d8146101c7578063f2fde38b146101dd578063f340fa01146101fd57600080fd5b80633ccfd60b146100c25780633f4ba83a146100d75780634fe47f70146100ec578063558a72971461010c5780635f48f3931461012c578063715018a61461015557600080fd5b366100bd576100bb333334610210565b005b600080fd5b3480156100ce57600080fd5b506100bb61031c565b3480156100e357600080fd5b506100bb610353565b3480156100f857600080fd5b506100bb610107366004610664565b6103b7565b34801561011857600080fd5b506100bb610127366004610699565b6103ef565b34801561013857600080fd5b5061014260015481565b6040519081526020015b60405180910390f35b34801561016157600080fd5b506100bb610456565b34801561017657600080fd5b506100bb61046a565b34801561018b57600080fd5b506100bb61019a366004610664565b6104d1565b3480156101ab57600080fd5b506000546040516001600160a01b03909116815260200161014c565b3480156101d357600080fd5b5061014260025481565b3480156101e957600080fd5b506100bb6101f83660046106d5565b610509565b6100bb61020b3660046106d5565b610544565b60045460ff16156102595760405162461bcd60e51b815260206004820152600e60248201526d696e76616c69642073746174757360901b60448201526064015b60405180910390fd5b600254811015801561026d57506001548111155b6102aa5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610250565b600380549060006102ba836106f7565b9190505550816001600160a01b0316836001600160a01b03167fcf1f679e6fab15306c35a02f98bb653ccbe4b8863acf1d569d0e2232a6da5be86003548460405161030f929190918252602082015260400190565b60405180910390a3505050565b61032461054f565b60405133904780156108fc02916000818181858888f19350505050158015610350573d6000803e3d6000fd5b50565b3360009081526005602052604090205460ff166103825760405162461bcd60e51b81526004016102509061071e565b6004805460ff191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b3360009081526005602052604090205460ff166103e65760405162461bcd60e51b81526004016102509061071e565b6103508161057c565b6103f761054f565b6001600160a01b038216600081815260056020908152604091829020805460ff191685151590811790915591519182527f1a594081ae893ab78e67d9b9e843547318164322d32c65369d78a96172d9dc8f910160405180910390a25050565b61045e61054f565b61046860006105c8565b565b3360009081526005602052604090205460ff166104995760405162461bcd60e51b81526004016102509061071e565b6004805460ff191660011790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b3360009081526005602052604090205460ff166105005760405162461bcd60e51b81526004016102509061071e565b61035081610618565b61051161054f565b6001600160a01b03811661053b57604051631e4fbdf760e01b815260006004820152602401610250565b610350816105c8565b610350338234610210565b6000546001600160a01b031633146104685760405163118cdaa760e01b8152336004820152602401610250565b6002548110156105c35760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081b585e08185b5bdd5b9d60721b6044820152606401610250565b600155565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60015481111561065f5760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081b5a5b88185b5bdd5b9d60721b6044820152606401610250565b600255565b60006020828403121561067657600080fd5b5035919050565b80356001600160a01b038116811461069457600080fd5b919050565b600080604083850312156106ac57600080fd5b6106b58361067d565b9150602083013580151581146106ca57600080fd5b809150509250929050565b6000602082840312156106e757600080fd5b6106f08261067d565b9392505050565b60006001820161071757634e487b7160e01b600052601160045260246000fd5b5060010190565b60208082526010908201526f34b73b30b634b21037b832b930ba37b960811b60408201526060019056fea2646970667358221220a28cf9c39993bed1859ad500b87686712833a02e9ae989456777e0497798721664736f6c63430008140033
Verified Source Code Partial Match
Compiler: v0.8.20+commit.a1b79de6
EVM: london
Optimization: Yes (200 runs)
XCashier.sol 218 lines
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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: contracts/XCashier.sol
pragma solidity ^0.8.20;
contract XCashier is Ownable {
event DepositReceived(address indexed sender, address indexed recipient, uint256 id, uint256 amount);
event Withdrawn(address, uint256);
event MinAmountSet(uint256);
event MaxAmountSet(uint256);
event OperatorSet(address indexed operator, bool active);
event Paused();
event Unpaused();
uint256 public maxAmount;
uint256 public minAmount;
uint256 private counter;
bool private paused;
mapping(address => bool) private operators;
modifier onlyOperator {
require(operators[msg.sender], "invalid operator");
_;
}
constructor(uint256 _minAmount, uint256 _maxAmount) Ownable(msg.sender) {
_setMaxAmount(_maxAmount);
_setMinAmount(_minAmount);
setOperator(msg.sender, true);
}
function _setMinAmount(uint256 _minAmount) internal {
require(_minAmount <= maxAmount, "invalid min amount");
minAmount = _minAmount;
}
function _setMaxAmount(uint256 _maxAmount) internal {
require(_maxAmount >= minAmount, "invalid max amount");
maxAmount = _maxAmount;
}
function setMinAmount(uint256 _minAmount) public onlyOperator {
_setMinAmount(_minAmount);
}
function setMaxAmount(uint256 _maxAmount) public onlyOperator {
_setMaxAmount(_maxAmount);
}
function pause() public onlyOperator {
paused = true;
emit Paused();
}
function unpause() public onlyOperator {
paused = false;
emit Unpaused();
}
function setOperator(address _operator, bool _active) public onlyOwner {
operators[_operator] = _active;
emit OperatorSet(_operator, _active);
}
function withdraw() public onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
function _deposit(address _sender, address _recipient, uint256 _amount) internal {
require(!paused, "invalid status");
require(_amount >= minAmount && _amount <= maxAmount, "invalid amount");
counter++;
emit DepositReceived(_sender, _recipient, counter, _amount);
}
function deposit(address _recipient) public payable {
_deposit(msg.sender, _recipient, msg.value);
}
receive() external payable {
_deposit(msg.sender, msg.sender, msg.value);
}
}
Read Contract
maxAmount 0x5f48f393 → uint256
minAmount 0x9b2cb5d8 → uint256
owner 0x8da5cb5b → address
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
deposit 0xf340fa01
address _recipient
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
setMaxAmount 0x4fe47f70
uint256 _maxAmount
setMinAmount 0x897b0637
uint256 _minAmount
setOperator 0x558a7297
address _operator
bool _active
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
withdraw 0x3ccfd60b
No parameters
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address