Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reverse proxy call to owner #26

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion contracts/contracts/Identity.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,21 @@ contract ProxyAccount is ERC725 {
// ----------------
// Public functions

function () external payable {}
function () external payable {
if (msg.sig != bytes4(0)) {
address root = toAddress(store[KEY_OWNER]);
assembly {
let ptr := mload(0x40)
calldatacopy(ptr, 0, calldatasize)
let result := call(gas, root, 0, ptr, calldatasize, 0, 0) // do we want to forward value ? my guess is no.
let size := returndatasize
returndatacopy(ptr, 0, size)
switch result
case 0 { revert (ptr, size) }
default { return (ptr, size) }
}
}
}

function getData(bytes32 _key) external view returns (bytes32 _value) {
return store[_key];
Expand Down