编译器
0.6.12+commit.27d51765
文件 1 的 2:ComptrollerProxy.sol
pragma solidity 0.6.12;
import "../../../utils/NonUpgradableProxy.sol";
contract ComptrollerProxy is NonUpgradableProxy {
constructor(bytes memory _constructData, address _comptrollerLib)
public
NonUpgradableProxy(_constructData, _comptrollerLib)
{}
}
文件 2 的 2:NonUpgradableProxy.sol
pragma solidity 0.6.12;
abstract contract NonUpgradableProxy {
address private immutable CONTRACT_LOGIC;
constructor(bytes memory _constructData, address _contractLogic) public {
CONTRACT_LOGIC = _contractLogic;
assembly {
sstore(
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,
_contractLogic
)
}
(bool success, bytes memory returnData) = _contractLogic.delegatecall(_constructData);
require(success, string(returnData));
}
fallback() external payable {
address contractLogic = CONTRACT_LOGIC;
assembly {
calldatacopy(0x0, 0x0, calldatasize())
let success := delegatecall(
sub(gas(), 10000),
contractLogic,
0x0,
calldatasize(),
0,
0
)
let retSz := returndatasize()
returndatacopy(0, 0, retSz)
switch success
case 0 {
revert(0, retSz)
}
default {
return(0, retSz)
}
}
}
}
{
"compilationTarget": {
"contracts/release/core/fund/comptroller/ComptrollerProxy.sol": "ComptrollerProxy"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"details": {
"constantOptimizer": true,
"cse": true,
"deduplicate": true,
"jumpdestRemover": true,
"orderLiterals": true,
"peephole": true,
"yul": false
},
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"bytes","name":"_constructData","type":"bytes"},{"internalType":"address","name":"_comptrollerLib","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"}]