ERC725Alliance / ERC725

Repository for code and discussion around ERC725 and related standards
Apache License 2.0
127 stars 66 forks source link

Add reverse proxy call to owner #35

Open frozeman opened 4 years ago

frozeman commented 4 years ago

This was proposed by @Amxx in this PR: https://github.com/ERC725Alliance/ERC725/pull/26 on the old code base.

owner might be a multisig, this allows read from/management of any eventual owning contract directly from the proxy. Usefull if the owning contract implements interfaces like ERC1271. That way dapps can call them without having to resolve the proxy ownership, thus making the proxy transparent

Very useful and should be discussed here.

This is especially relevant for the ERC725Account type (see types)

frozeman commented 2 years ago
       function fallback()
        public
        {
            address to = owner();
            assembly {
                calldatacopy(0, 0, calldatasize())
                let result := staticcall(gas(), to, 0, calldatasize(), 0, 0)
                returndatacopy(0, 0, returndatasize())
                switch result
                case 0  { revert (0, returndatasize()) }
                default { return (0, returndatasize()) }
            }
        }