commit 62c5a06ceca445f111ff11ca822a76c73b50e522
parent bd02667887efa4a471fe16dc940e8da11508edc7
Author: nolash <dev@holbrook.no>
Date: Fri, 30 Apr 2021 13:57:03 +0200
Add eip165 support
Diffstat:
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/python/eth_owned/runnable/void.py b/python/eth_owned/runnable/void.py
@@ -28,7 +28,7 @@ from chainlib.eth.connection import EthHTTPConnection
from chainlib.eth.tx import receipt
# local imports
-from eth_owned.void import VoidOwner
+from eth_owned.owned import Owned
logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger()
@@ -105,7 +105,6 @@ def main():
sys.stderr.write('EVM revert while transferring ownership')
sys.exit(1)
- c = VoidOwner(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
(tx_hash_hex, o) = c.take_ownership(signer_address, void_receiver_address)
rpc.do(o)
r = rpc.wait(tx_hash_hex)
diff --git a/solidity/VoidOwner.sol b/solidity/VoidOwner.sol
@@ -6,7 +6,7 @@ contract VoidOwner {
event OwnershipTaken(address _result);
-// function omNom(address _contract) public returns (bool) {
+ // Implements OwnedTaker
function takeOwnership(address _contract) public returns (bool) {
bool ok;
bytes memory result;
@@ -23,4 +23,15 @@ contract VoidOwner {
emit OwnershipTaken(_contract);
return ok;
}
+
+ // Implements EIP165
+ function supportsInterface(bytes4 _sum) public pure returns (bool) {
+ if (_sum == 0x6b578339) { // OwnedTaker
+ return true;
+ }
+ if (_sum == 0x01ffc9a7) { // EIP165
+ return true;
+ }
+ return false;
+ }
}