zellic-audit
Initial commit
f998fcd
raw
history blame
2.24 kB
{
"language": "Solidity",
"sources": {
"contracts/AccountProxy.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {OperationCenterInterface} from \"./interfaces/IOperationCenter.sol\";\n\ncontract AccountProxy {\n\n // auth is shared storage with AccountProxy and any OpCode.\n mapping(address => bool) internal _auth;\n\n address internal immutable opCenterAddress;\n\n constructor(address _opCenterAddress) {\n opCenterAddress = _opCenterAddress;\n }\n\n fallback() external payable {\n delegate(msg.sig);\n }\n\n receive() external payable {\n if (msg.sig != 0x00000000) {\n delegate(msg.sig);\n }\n }\n\n function delegate(bytes4 _sig) internal {\n address _opCodeAddress = OperationCenterInterface(opCenterAddress)\n .getOpCodeAddress(_sig);\n require(_opCodeAddress != address(0), \"CHFRY Account: Not found OpCode\");\n assembly {\n calldatacopy(0, 0, calldatasize())\n let result := delegatecall(gas(), _opCodeAddress, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n switch result\n case 0 { revert(0, returndatasize()) }\n default { return(0, returndatasize()) }\n }\n }\n}\n"
},
"contracts/interfaces/IOperationCenter.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface OperationCenterInterface {\n function eventCenterAddress() external view returns (address);\n function connectorCenterAddress() external view returns (address);\n function tokenCenterAddress() external view returns (address);\n function protocolCenterAddress() external view returns (address);\n function getOpCodeAddress(bytes4 _sig) external view returns (address);\n}"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}