Verified contractPartial
Account
Address0x710c9f9014b177dd59a3fc5ef7f9098ff4e6ec54
- Balance
0.000487 ETH
- Transactions
2
- Compiler
solc 0.5.10
- Same code
20 more contracts
Details
- Compiler
- solc 0.5.10+commit.5a6ea5b1
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 8,393,172
- Creation transaction
- 0x1e4d4f2277…a8b826dc88
Account.sol
// Recovered by EthereumHistory (ethereumhistory.com) -sw
pragma solidity ^0.5.10;
contract AbstractAccount {
event DeviceAdded(address device, bool isOwner);
event DeviceRemoved(address device);
event TransactionExecuted(address recipient, uint256 value, bytes data, bytes response);
struct Device {
bool isOwner;
bool exists;
bool existed;
}
mapping(address => Device) public devices;
function addDevice(address _device, bool _isOwner) public;
function removeDevice(address _device) public;
function executeTransaction(address payable _recipient, uint256 _value, bytes memory _data) public returns (bytes memory _response);
}
/**
* @title Account
*/
contract Account is AbstractAccount {
modifier onlyOwner() {
require(
devices[msg.sender].isOwner
);
_;
}
constructor() public {
devices[msg.sender].isOwner = true;
devices[msg.sender].exists = true;
devices[msg.sender].existed = true;
}
function() external payable {
//
}
function addDevice(address _device, bool _isOwner) onlyOwner public {
require(
_device != address(0)
);
require(
!devices[_device].exists
);
devices[_device].isOwner = _isOwner;
devices[_device].exists = true;
devices[_device].existed = true;
emit DeviceAdded(_device, _isOwner);
}
function removeDevice(address _device) onlyOwner public {
require(
devices[_device].exists
);
devices[_device].isOwner = false;
devices[_device].exists = false;
emit DeviceRemoved(_device);
}
function executeTransaction(address payable _recipient, uint256 _value, bytes memory _data) onlyOwner public returns (bytes memory _response) {
require(
_recipient != address(0)
);
bool _succeeded;
(_succeeded, _response) = _recipient.call.value(_value)(_data);
require(
_succeeded
);
emit TransactionExecuted(_recipient, _value, _data, _response);
}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": true
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.