文件 1 的 3:AuctionHouseProxiedV1.sol
pragma solidity 0.6.6;
import "./VCProxy.sol";
import "./AuctionHouseV1.sol";
contract AuctionHouseProxiedV1 is VCProxy, AuctionHouseHeaderV1, AuctionHouseStorageInternalV1 {
constructor(uint256 _version, address _vc) public
VCProxy(_version, _vc)
{
}
}
文件 2 的 3:AuctionHouseV1.sol
pragma solidity 0.6.6;
contract AuctionHouseHeaderV1 {
event Deposit(uint256 indexed amount, address indexed beneficiary, address indexed contributor, address origin);
event UserWithdrawal(uint256 indexed amount, address indexed account);
event UserBid(address indexed auction, uint256 indexed bidValue, address indexed bidder);
event UserCancelledBid(address indexed auction, address indexed bidder);
event UserWin(address indexed auction, uint256 indexed bidValue, address indexed bidder);
event UserSell(address indexed auction);
event UserSellingPriceAdjust(address indexed auction, uint256 indexed value);
}
contract AuctionHouseStorageInternalV1 {
bool internal initialized;
address internal factory;
address internal index;
mapping (address => uint) internal pendingWithdrawals;
address internal ERC2665Lieutenant;
address internal kycContract;
}
contract AuctionHouseStoragePublicV1 {
bool public initialized;
address public factory;
address public index;
mapping (address => uint) public pendingWithdrawals;
address public ERC2665Lieutenant;
address public kycContract;
}
文件 3 的 3:VCProxy.sol
pragma solidity 0.6.6;
contract VersionControlStoragePublic {
address[] public code;
}
contract VCProxyData {
address internal vc;
uint256 internal version;
}
contract VCProxy is VCProxyData {
constructor(uint256 _version, address _vc) public {
version = _version;
vc = _vc;
}
fallback () virtual external payable {
address addr = VersionControlStoragePublic(vc).code(version);
assembly {
let freememstart := mload(0x40)
calldatacopy(freememstart, 0, calldatasize())
let success := delegatecall(not(0), addr, freememstart, calldatasize(), freememstart, 0)
returndatacopy(freememstart, 0, returndatasize())
switch success
case 0 { revert(freememstart, returndatasize()) }
default { return(freememstart, returndatasize()) }
}
}
receive() virtual external payable{
require(false, "Do not send me Eth without a reason");
}
}
{
"compilationTarget": {
"browser/AuctionHouseProxiedV1.sol": "AuctionHouseProxiedV1"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"uint256","name":"_version","type":"uint256"},{"internalType":"address","name":"_vc","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"contributor","type":"address"},{"indexed":false,"internalType":"address","name":"origin","type":"address"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"auction","type":"address"},{"indexed":true,"internalType":"uint256","name":"bidValue","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"}],"name":"UserBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"auction","type":"address"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"}],"name":"UserCancelledBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"auction","type":"address"}],"name":"UserSell","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"auction","type":"address"},{"indexed":true,"internalType":"uint256","name":"value","type":"uint256"}],"name":"UserSellingPriceAdjust","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"auction","type":"address"},{"indexed":true,"internalType":"uint256","name":"bidValue","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"}],"name":"UserWin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"UserWithdrawal","type":"event"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]