Address Contract Verified
Address
0x52Aa899454998Be5b000Ad077a46Bbe360F4e497
Balance
30273.54 ETH
Nonce
1
Code Size
4462 bytes
Creator
Create2 Deployer at tx 0x40a302e6...016689
Proxy
EIP-1967 Proxy Implementation: 0xa57D7CeF...29f6
Indexed Transactions
0
Contract Bytecode
4462 bytes
0x60806040526004361061009a5760003560e01c8063908bfe5e11610069578063b5c736e41161004e578063b5c736e414610241578063c39aa07d1461026e578063f0c01b421461028e576100a1565b8063908bfe5e1461020c578063a5fcc8bc14610221576100a1565b806322175a321461015e5780636e9960c314610180578063704b6c02146101bf57806389396dc8146101df576100a1565b366100a157005b7b3ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6000357fffffffff0000000000000000000000000000000000000000000000000000000016175473ffffffffffffffffffffffffffffffffffffffff811661013b576040517fc44f8d3b00000000000000000000000000000000000000000000000000000000815261c35160048201526024015b60405180910390fd5b3660008037600080366000845af43d6000803e80610158573d6000fd5b503d6000f35b34801561016a57600080fd5b5061017e610179366004610f48565b6102ae565b005b34801561018c57600080fd5b50610195610356565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101cb57600080fd5b5061017e6101da366004610f48565b610365565b3480156101eb57600080fd5b506101ff6101fa366004610f48565b61040a565b6040516101b69190610f63565b34801561021857600080fd5b5061019561041b565b34801561022d57600080fd5b5061019561023c366004610fc9565b610425565b34801561024d57600080fd5b5061026061025c36600461100b565b5490565b6040519081526020016101b6565b34801561027a57600080fd5b5061017e610289366004610f48565b610430565b34801561029a57600080fd5b5061017e6102a9366004611024565b6104d5565b6102b66105b3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461034a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c792d61646d696e000000000000000000000000000000000000000000006044820152606401610132565b610353816105dd565b50565b60006103606105b3565b905090565b61036d6105b3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c792d61646d696e000000000000000000000000000000000000000000006044820152606401610132565b610353816107ff565b606061041582610935565b92915050565b6000610360610a4f565b600061041582610a79565b6104386105b3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c792d61646d696e000000000000000000000000000000000000000000006044820152606401610132565b61035381610aa6565b6104dd6105b3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c792d61646d696e000000000000000000000000000000000000000000006044820152606401610132565b6105ae83838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610b3992505050565b505050565b60006103607fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b604080516020808201839052601c60608301527f656970313936372e70726f78792e696d706c656d656e746174696f6e0000000060808084019190915273ffffffffffffffffffffffffffffffffffffffff8516838501528351808403909101815260a090920190925280519101206000818054604080516020808402820181019092528281529291908301828280156106d857602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116106855790505b50505050509050805160000361074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f696d706c656d656e746174696f6e2d6e6f742d657869737400000000000000006044820152606401610132565b60005b81518110156107ad57600061079683838151811061076d5761076d6110aa565b60200260200101517b3ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc1790565b6000905550806107a5816110d9565b91505061074d565b506107b9826000610e39565b60405173ffffffffffffffffffffffffffffffffffffffff8416907fda53aaefabec4c3f8ba693a2e3c67fa0152fbd71c369d51f669e66b28a4a086490600090a2505050565b60006108096105b3565b905073ffffffffffffffffffffffffffffffffffffffff82166108ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610132565b6108d77fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103839055565b8173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fb2396a4169c0fac3eb0713eb7d54220cbe5e21e585a59578ec4de929657c073360405160405180910390a35050565b606060006109b6836040805160208101829052601c60608201527f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000608082015273ffffffffffffffffffffffffffffffffffffffff83169181019190915260009060a001604051602081830303815290604052805190602001209050919050565b905080805460408051602080840282018101909252828152929190830182828015610a4257602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116109ef5790505b5050505050915050919050565b60006103607f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b7b3ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81178054600091905b9392505050565b6000610ab0610a4f565b9050610adb7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc839055565b8173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f761380f4203cd2fcc7ee1ae32561463bc08bbf6761cb9d5caa925f99a6d5450260405160405180910390a35050565b8051600003610ba4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f6e6f2d73696773000000000000000000000000000000000000000000000000006044820152606401610132565b604080516020808201839052601c60608301527f656970313936372e70726f78792e696d706c656d656e746174696f6e0000000060808084019190915273ffffffffffffffffffffffffffffffffffffffff8616838501528351808403909101815260a09092019092528051910120600081805460408051602080840282018101909252828152929190830182828015610c9f57602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019060040190602082600301049283019260010382029150808411610c4c5790505b505050505090508051600014610d11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f696d706c656d656e746174696f6e2d616c72656164792d6578697374000000006044820152606401610132565b60005b8351811015610dd2576000610d3485838151811061076d5761076d6110aa565b90506000610d40825490565b73ffffffffffffffffffffffffffffffffffffffff1614610dbd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f7369672d616c72656164792d65786973740000000000000000000000000000006044820152606401610132565b85905580610dca816110d9565b915050610d14565b5082828151610de49260200190610e5e565b508373ffffffffffffffffffffffffffffffffffffffff167fd613a4a18e567ee1f2db4d5b528a5fee09f7dff92d6fb708afd6c095070a9c6d84604051610e2b9190610f63565b60405180910390a250505050565b5080546000825560070160089004906000526020600020908101906103539190610f0a565b82805482825590600052602060002090600701600890048101928215610efa5791602002820160005b83821115610ec857835183826101000a81548163ffffffff021916908360e01c02179055509260200192600401602081600301049283019260010302610e87565b8015610ef85782816101000a81549063ffffffff0219169055600401602081600301049283019260010302610ec8565b505b50610f06929150610f0a565b5090565b5b80821115610f065760008155600101610f0b565b803573ffffffffffffffffffffffffffffffffffffffff81168114610f4357600080fd5b919050565b600060208284031215610f5a57600080fd5b610a9f82610f1f565b6020808252825182820181905260009190848201906040850190845b81811015610fbd5783517fffffffff000000000000000000000000000000000000000000000000000000001683529284019291840191600101610f7f565b50909695505050505050565b600060208284031215610fdb57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610a9f57600080fd5b60006020828403121561101d57600080fd5b5035919050565b60008060006040848603121561103957600080fd5b61104284610f1f565b9250602084013567ffffffffffffffff8082111561105f57600080fd5b818601915086601f83011261107357600080fd5b81358181111561108257600080fd5b8760208260051b850101111561109757600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611131577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea2646970667358221220f0ded691978ced5e475a50bf098a14af3b604d9b88d5f7ba32221c2d31d6f40064736f6c63430008150033
Verified Source Code Full Match
Compiler: v0.8.21+commit.d9974bed
EVM: paris
Optimization: Yes (10000000 runs)
proxy.sol 11 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
import { Proxy } from "../infiniteProxy/proxy.sol";
/// @notice Fluid Liquidity infinte proxy.
/// Liquidity is the central point of the Instadapp Fluid architecture, it is the core interaction point
/// for all allow-listed protocols, such as fTokens, Vault, Flashloan, StETH protocol, DEX protocol etc.
contract FluidLiquidityProxy is Proxy {
constructor(address admin_, address dummyImplementation_) Proxy(admin_, dummyImplementation_) {}
}
error.sol 6 lines
//SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
contract Error {
error FluidInfiniteProxyError(uint256 errorId_);
}
proxy.sol 240 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { Events } from "./events.sol";
import { ErrorTypes } from "./errorTypes.sol";
import { Error } from "./error.sol";
import { StorageRead } from "../libraries/storageRead.sol";
contract CoreInternals is StorageRead, Events, Error {
struct SigsSlot {
bytes4[] value;
}
/// @dev Storage slot with the admin of the contract.
/// This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
/// validated in the constructor.
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/// @dev Storage slot with the address of the current dummy-implementation.
/// This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
/// validated in the constructor.
bytes32 internal constant _DUMMY_IMPLEMENTATION_SLOT =
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/// @dev use EIP1967 proxy slot (see _DUMMY_IMPLEMENTATION_SLOT) except for first 4 bytes,
// which are set to 0. This is combined with a sig which will be set in those first 4 bytes
bytes32 internal constant _SIG_SLOT_BASE = 0x000000003ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/// @dev Returns the storage slot which stores the sigs array set for the implementation.
function _getSlotImplSigsSlot(address implementation_) internal pure returns (bytes32) {
return keccak256(abi.encode("eip1967.proxy.implementation", implementation_));
}
/// @dev Returns the storage slot which stores the implementation address for the function sig.
function _getSlotSigsImplSlot(bytes4 sig_) internal pure returns (bytes32 result_) {
assembly {
// or operator sets sig_ in first 4 bytes with rest of bytes32 having default value of _SIG_SLOT_BASE
result_ := or(_SIG_SLOT_BASE, sig_)
}
}
/// @dev Returns an address `data_` located at `slot_`.
function _getAddressSlot(bytes32 slot_) internal view returns (address data_) {
assembly {
data_ := sload(slot_)
}
}
/// @dev Sets an address `data_` located at `slot_`.
function _setAddressSlot(bytes32 slot_, address data_) internal {
assembly {
sstore(slot_, data_)
}
}
/// @dev Returns an `SigsSlot` with member `value` located at `slot`.
function _getSigsSlot(bytes32 slot_) internal pure returns (SigsSlot storage _r) {
assembly {
_r.slot := slot_
}
}
/// @dev Sets new implementation and adds mapping from implementation to sigs and sig to implementation.
function _setImplementationSigs(address implementation_, bytes4[] memory sigs_) internal {
require(sigs_.length != 0, "no-sigs");
bytes32 slot_ = _getSlotImplSigsSlot(implementation_);
bytes4[] memory sigsCheck_ = _getSigsSlot(slot_).value;
require(sigsCheck_.length == 0, "implementation-already-exist");
for (uint256 i; i < sigs_.length; i++) {
bytes32 sigSlot_ = _getSlotSigsImplSlot(sigs_[i]);
require(_getAddressSlot(sigSlot_) == address(0), "sig-already-exist");
_setAddressSlot(sigSlot_, implementation_);
}
_getSigsSlot(slot_).value = sigs_;
emit LogSetImplementation(implementation_, sigs_);
}
/// @dev Removes implementation and the mappings corresponding to it.
function _removeImplementationSigs(address implementation_) internal {
bytes32 slot_ = _getSlotImplSigsSlot(implementation_);
bytes4[] memory sigs_ = _getSigsSlot(slot_).value;
require(sigs_.length != 0, "implementation-not-exist");
for (uint256 i; i < sigs_.length; i++) {
bytes32 sigSlot_ = _getSlotSigsImplSlot(sigs_[i]);
_setAddressSlot(sigSlot_, address(0));
}
delete _getSigsSlot(slot_).value;
emit LogRemoveImplementation(implementation_);
}
/// @dev Returns bytes4[] sigs from implementation address. If implemenatation is not registered then returns empty array.
function _getImplementationSigs(address implementation_) internal view returns (bytes4[] memory) {
bytes32 slot_ = _getSlotImplSigsSlot(implementation_);
return _getSigsSlot(slot_).value;
}
/// @dev Returns implementation address from bytes4 sig. If sig is not registered then returns address(0).
function _getSigImplementation(bytes4 sig_) internal view returns (address implementation_) {
bytes32 slot_ = _getSlotSigsImplSlot(sig_);
return _getAddressSlot(slot_);
}
/// @dev Returns the current admin.
function _getAdmin() internal view returns (address) {
return _getAddressSlot(_ADMIN_SLOT);
}
/// @dev Returns the current dummy-implementation.
function _getDummyImplementation() internal view returns (address) {
return _getAddressSlot(_DUMMY_IMPLEMENTATION_SLOT);
}
/// @dev Stores a new address in the EIP1967 admin slot.
function _setAdmin(address newAdmin_) internal {
address oldAdmin_ = _getAdmin();
require(newAdmin_ != address(0), "ERC1967: new admin is the zero address");
_setAddressSlot(_ADMIN_SLOT, newAdmin_);
emit LogSetAdmin(oldAdmin_, newAdmin_);
}
/// @dev Stores a new address in the EIP1967 implementation slot.
function _setDummyImplementation(address newDummyImplementation_) internal {
address oldDummyImplementation_ = _getDummyImplementation();
_setAddressSlot(_DUMMY_IMPLEMENTATION_SLOT, newDummyImplementation_);
emit LogSetDummyImplementation(oldDummyImplementation_, newDummyImplementation_);
}
}
contract AdminInternals is CoreInternals {
/// @dev Only admin guard
modifier onlyAdmin() {
require(msg.sender == _getAdmin(), "only-admin");
_;
}
constructor(address admin_, address dummyImplementation_) {
_setAdmin(admin_);
_setDummyImplementation(dummyImplementation_);
}
/// @dev Sets new admin.
function setAdmin(address newAdmin_) external onlyAdmin {
_setAdmin(newAdmin_);
}
/// @dev Sets new dummy-implementation.
function setDummyImplementation(address newDummyImplementation_) external onlyAdmin {
_setDummyImplementation(newDummyImplementation_);
}
/// @dev Adds new implementation address.
function addImplementation(address implementation_, bytes4[] calldata sigs_) external onlyAdmin {
_setImplementationSigs(implementation_, sigs_);
}
/// @dev Removes an existing implementation address.
function removeImplementation(address implementation_) external onlyAdmin {
_removeImplementationSigs(implementation_);
}
}
/// @title Proxy
/// @notice This abstract contract provides a fallback function that delegates all calls to another contract using the EVM.
/// It implements the Instadapp infinite-proxy: https://github.com/Instadapp/infinite-proxy
abstract contract Proxy is AdminInternals {
constructor(address admin_, address dummyImplementation_) AdminInternals(admin_, dummyImplementation_) {}
/// @dev Returns admin's address.
function getAdmin() external view returns (address) {
return _getAdmin();
}
/// @dev Returns dummy-implementations's address.
function getDummyImplementation() external view returns (address) {
return _getDummyImplementation();
}
/// @dev Returns bytes4[] sigs from implementation address If not registered then returns empty array.
function getImplementationSigs(address impl_) external view returns (bytes4[] memory) {
return _getImplementationSigs(impl_);
}
/// @dev Returns implementation address from bytes4 sig. If sig is not registered then returns address(0).
function getSigsImplementation(bytes4 sig_) external view returns (address) {
return _getSigImplementation(sig_);
}
/// @dev Fallback function that delegates calls to the address returned by Implementations registry.
fallback() external payable {
address implementation_;
assembly {
// get slot for sig and directly SLOAD implementation address from storage at that slot
implementation_ := sload(
// same as in `_getSlotSigsImplSlot()` but we must also load msg.sig from calldata.
// msg.sig is first 4 bytes of calldata, so we can use calldataload(0) with a mask
or(
// or operator sets sig_ in first 4 bytes with rest of bytes32 having default value of _SIG_SLOT_BASE
_SIG_SLOT_BASE,
and(calldataload(0), 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)
)
)
}
if (implementation_ == address(0)) {
revert FluidInfiniteProxyError(ErrorTypes.InfiniteProxy__ImplementationNotExist);
}
// Delegate the current call to `implementation`.
// This does not return to its internall call site, it will return directly to the external caller.
// solhint-disable-next-line no-inline-assembly
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation_, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
if eq(result, 0) {
// delegatecall returns 0 on error.
revert(0, returndatasize())
}
return(0, returndatasize())
}
}
receive() external payable {
// receive method can never have calldata in EVM so no need for any logic here
}
}
events.sol 16 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
contract Events {
/// @notice emitted when a new admin is set
event LogSetAdmin(address indexed oldAdmin, address indexed newAdmin);
/// @notice emitted when a new dummy implementation is set
event LogSetDummyImplementation(address indexed oldDummyImplementation, address indexed newDummyImplementation);
/// @notice emitted when a new implementation is set with certain sigs
event LogSetImplementation(address indexed implementation, bytes4[] sigs);
/// @notice emitted when an implementation is removed
event LogRemoveImplementation(address indexed implementation);
}
storageRead.sol 11 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
/// @notice implements a method to read uint256 data from storage at a bytes32 storage slot key.
contract StorageRead {
function readFromStorage(bytes32 slot_) public view returns (uint256 result_) {
assembly {
result_ := sload(slot_) // read value from the storage slot
}
}
}
errorTypes.sol 11 lines
//SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
library ErrorTypes {
/***********************************|
| Infinite proxy |
|__________________________________*/
/// @notice thrown when an implementation does not exist
uint256 internal constant InfiniteProxy__ImplementationNotExist = 50001;
}
Read Contract
getAdmin 0x6e9960c3 → address
getDummyImplementation 0x908bfe5e → address
getImplementationSigs 0x89396dc8 → bytes4[]
getSigsImplementation 0xa5fcc8bc → address
readFromStorage 0xb5c736e4 → uint256
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
addImplementation 0xf0c01b42
address implementation_
bytes4[] sigs_
removeImplementation 0x22175a32
address implementation_
setAdmin 0x704b6c02
address newAdmin_
setDummyImplementation 0xc39aa07d
address newDummyImplementation_
Token Balances (5)
View Transfers →Recent Transactions
No transactions found for this address