文件 1 的 1:CatnipV2Proxy.sol
pragma solidity ^0.6.6;
contract CatnipV2Proxy {
event myEvent(bytes);
constructor(bytes memory constructData, address contractLogic) public {
assembly {
sstore(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7, contractLogic)
}
(bool success, bytes memory _ ) = contractLogic.delegatecall(constructData);
emit myEvent(_);
require(success, "Construction failed");
}
fallback() external payable {
assembly {
let contractLogic := sload(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7)
calldatacopy(0x0, 0x0, calldatasize())
let success := delegatecall(gas(), contractLogic, 0x0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch success
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
}
{
"compilationTarget": {
"CatnipV2Proxy.sol": "CatnipV2Proxy"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}