This contract's source code is verified! Compiler
0.8.21+commit.d9974bed
File 1 of 6: AbstractProxy.sol
pragma solidity >=0.8.11 <0.9.0;
abstract contract AbstractProxy {
fallback ( ) external payable {
_forward();
}
receive ( ) external payable {
_forward();
}
function _forward ( ) internal {
address implementation = _getImplementation();
assembly {
calldatacopy (0 , 0 , calldatasize ())
let result := delegatecall (gas (), implementation, 0 , calldatasize (), 0 , 0 )
returndatacopy (0 , 0 , returndatasize ())
switch result
case 0 {
revert (0 , returndatasize ())
}
default {
return (0 , returndatasize ())
}
}
}
function _getImplementation ( ) internal view virtual returns (address ) ;
}
File 2 of 6: AddressError.sol
pragma solidity >=0.8.11 <0.9.0;
library AddressError {
error ZeroAddress ( ) ;
error NotAContract (address contr ) ;
}
File 3 of 6: AddressUtil.sol
pragma solidity >=0.8.11 <0.9.0;
library AddressUtil {
function isContract (address account ) internal view returns (bool ) {
uint256 size;
assembly {
size := extcodesize (account)
}
return size > 0 ;
}
}
File 4 of 6: InfinexProxy.sol
pragma solidity ^0.8.21;
import { UUPSProxy } from "@synthetixio/core-contracts/contracts/proxy/UUPSProxy.sol" ;
contract InfinexProxy is UUPSProxy {
constructor (address firstImplementation ) UUPSProxy (firstImplementation ) { }
}
File 5 of 6: ProxyStorage.sol
pragma solidity >=0.8.11 <0.9.0;
contract ProxyStorage {
bytes32 private constant _SLOT_PROXY_STORAGE =
keccak256 (abi .encode ("io.synthetix.core-contracts.Proxy" ));
struct ProxyStore {
address implementation;
bool simulatingUpgrade;
}
function _proxyStore ( ) internal pure returns (ProxyStore storage store ) {
bytes32 s = _SLOT_PROXY_STORAGE;
assembly {
store.slot := s
}
}
}
File 6 of 6: UUPSProxy.sol
pragma solidity >=0.8.11 <0.9.0;
import "./AbstractProxy.sol" ;
import "./ProxyStorage.sol" ;
import "../errors/AddressError.sol" ;
import "../utils/AddressUtil.sol" ;
contract UUPSProxy is AbstractProxy , ProxyStorage {
constructor (address firstImplementation ) {
if (firstImplementation = = address (0 )) {
revert AddressError.ZeroAddress();
}
if (! AddressUtil.isContract(firstImplementation)) {
revert AddressError.NotAContract(firstImplementation);
}
_proxyStore().implementation = firstImplementation;
}
function _getImplementation ( ) internal view virtual override returns (address ) {
return _proxyStore().implementation;
}
}
{
"compilationTarget" : {
"src/proxy/InfinexProxy.sol" : "InfinexProxy"
} ,
"evmVersion" : "shanghai" ,
"libraries" : { } ,
"metadata" : {
"bytecodeHash" : "ipfs"
} ,
"optimizer" : {
"enabled" : true ,
"runs" : 200
} ,
"remappings" : [
":@ensdomains/=lib/ERC721A/node_modules/@ensdomains/" ,
":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" ,
":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" ,
":@pythnetwork/entropy-sdk-solidity/=node_modules/@pythnetwork/entropy-sdk-solidity/" ,
":@synthetixio/core-contracts/=node_modules/@synthetixio/core-contracts/" ,
":@synthetixio/core-modules/=node_modules/@synthetixio/core-modules/" ,
":@synthetixio/main/=node_modules/@synthetixio/main/" ,
":@synthetixio/oracle-manager/=node_modules/@synthetixio/oracle-manager/" ,
":@synthetixio/perps-market/=node_modules/@synthetixio/perps-market/" ,
":@synthetixio/spot-market/=node_modules/@synthetixio/spot-market/" ,
":ERC721A/=lib/ERC721A/contracts/" ,
":cannon-std/=lib/cannon-std/src/" ,
":ds-test/=lib/forge-std/lib/ds-test/src/" ,
":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/" ,
":eth-gas-reporter/=lib/ERC721A/node_modules/eth-gas-reporter/" ,
":forge-std/=lib/forge-std/src/" ,
":hardhat/=lib/ERC721A/node_modules/hardhat/" ,
":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/" ,
":openzeppelin-contracts/=lib/openzeppelin-contracts/" ,
":solady/=lib/solady/src/" ,
":src/=src/" ,
":test/=test/" ,
":wormhole-circle-integration/=lib/wormhole-circle-integration/evm/src/" ,
":wormhole-solidity-sdk/=lib/wormhole-solidity-sdk/src/" ,
":wormhole/=lib/wormhole-circle-integration/evm/src/"
]
} [{"inputs":[{"internalType":"address","name":"firstImplementation","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"contr","type":"address"}],"name":"NotAContract","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]