Overview
ETH Balance
ETH Value
$0.00Multichain Info
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Admin | 5297905 | 91 days ago | IN | 0 ETH | 0 |
View more zero value Internal Transactions in Advanced View mode
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { Admin } from "contracts/base/Admin.sol"; library SickleRegistryEvents { event CollectorChanged(address newCollector); event FeesUpdated(bytes32[] feeHashes, uint256[] feesInBP); event ReferralCodeCreated(bytes32 indexed code, address indexed referrer); // Multicall caller and target whitelist status changes event CallerStatusChanged(address caller, bool isWhitelisted); event TargetStatusChanged(address target, bool isWhitelisted); } /// @title SickleRegistry contract /// @author vfat.tools /// @notice Manages the whitelisted contracts and the collector address contract SickleRegistry is Admin { /// CONSTANTS /// uint256 constant MAX_FEE = 500; // 5% /// ERRORS /// error ArrayLengthMismatch(); // 0xa24a13a6 error FeeAboveMaxLimit(); // 0xd6cf7b5e error InvalidReferralCode(); // 0xe55b4629 /// STORAGE /// /// @notice Address of the fee collector address public collector; /// @notice Tracks the contracts that can be called through Sickle multicall /// @return True if the contract is a whitelisted target mapping(address => bool) public isWhitelistedTarget; /// @notice Tracks the contracts that can call Sickle multicall /// @return True if the contract is a whitelisted caller mapping(address => bool) public isWhitelistedCaller; /// @notice Keeps track of the referrers and their associated code mapping(bytes32 => address) public referralCodes; /// @notice Mapping for fee hashes (hash of the strategy contract addresses /// and the function selectors) and their associated fees /// @return The fee in basis points to apply to the transaction amount mapping(bytes32 => uint256) public feeRegistry; /// WRITE FUNCTIONS /// /// @param admin_ Address of the admin /// @param collector_ Address of the collector constructor(address admin_, address collector_) Admin(admin_) { collector = collector_; } /// @notice Updates the whitelist status for multiple multicall targets /// @param targets Addresses of the contracts to update /// @param isApproved New status for the contracts /// @custom:access Restricted to protocol admin. function setWhitelistedTargets( address[] calldata targets, bool isApproved ) external onlyAdmin { for (uint256 i; i < targets.length;) { isWhitelistedTarget[targets[i]] = isApproved; emit SickleRegistryEvents.TargetStatusChanged( targets[i], isApproved ); unchecked { ++i; } } } /// @notice Updates the fee collector address /// @param newCollector Address of the new fee collector /// @custom:access Restricted to protocol admin. function updateCollector( address newCollector ) external onlyAdmin { collector = newCollector; emit SickleRegistryEvents.CollectorChanged(newCollector); } /// @notice Update the whitelist status for multiple multicall callers /// @param callers Addresses of the callers /// @param isApproved New status for the caller /// @custom:access Restricted to protocol admin. function setWhitelistedCallers( address[] calldata callers, bool isApproved ) external onlyAdmin { for (uint256 i; i < callers.length;) { isWhitelistedCaller[callers[i]] = isApproved; emit SickleRegistryEvents.CallerStatusChanged( callers[i], isApproved ); unchecked { ++i; } } } /// @notice Associates a referral code to the address of the caller function setReferralCode( bytes32 referralCode ) external { if (referralCodes[referralCode] != address(0)) { revert InvalidReferralCode(); } referralCodes[referralCode] = msg.sender; emit SickleRegistryEvents.ReferralCodeCreated(referralCode, msg.sender); } /// @notice Update the fees for multiple strategy functions /// @param feeHashes Array of fee hashes /// @param feesArray Array of fees to apply (in basis points) /// @custom:access Restricted to protocol admin. function setFees( bytes32[] calldata feeHashes, uint256[] calldata feesArray ) external onlyAdmin { if (feeHashes.length != feesArray.length) { revert ArrayLengthMismatch(); } for (uint256 i = 0; i < feeHashes.length;) { if (feesArray[i] <= MAX_FEE) { feeRegistry[feeHashes[i]] = feesArray[i]; } else { revert FeeAboveMaxLimit(); } unchecked { ++i; } } emit SickleRegistryEvents.FeesUpdated(feeHashes, feesArray); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /// @title Admin contract /// @author vfat.tools /// @notice Provides an administration mechanism allowing restricted functions abstract contract Admin { /// ERRORS /// /// @notice Thrown when the caller is not the admin error NotAdminError(); //0xb5c42b3b /// EVENTS /// /// @notice Emitted when a new admin is set /// @param oldAdmin Address of the old admin /// @param newAdmin Address of the new admin event AdminSet(address oldAdmin, address newAdmin); /// STORAGE /// /// @notice Address of the current admin address public admin; /// MODIFIERS /// /// @dev Restricts a function to the admin modifier onlyAdmin() { if (msg.sender != admin) revert NotAdminError(); _; } /// WRITE FUNCTIONS /// /// @param admin_ Address of the admin constructor( address admin_ ) { emit AdminSet(address(0), admin_); admin = admin_; } /// @notice Sets a new admin /// @param newAdmin Address of the new admin /// @custom:access Restricted to protocol admin. function setAdmin( address newAdmin ) external onlyAdmin { emit AdminSet(admin, newAdmin); admin = newAdmin; } }
{ "remappings": [ "solmate/=lib/solmate/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "@morpho-blue/=lib/morpho-blue/src/", "ds-test/=lib/solmate/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "morpho-blue/=lib/morpho-blue/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"admin_","type":"address"},{"internalType":"address","name":"collector_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"FeeAboveMaxLimit","type":"error"},{"inputs":[],"name":"InvalidReferralCode","type":"error"},{"inputs":[],"name":"NotAdminError","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminSet","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"feeRegistry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelistedCaller","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelistedTarget","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"referralCodes","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"feeHashes","type":"bytes32[]"},{"internalType":"uint256[]","name":"feesArray","type":"uint256[]"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"referralCode","type":"bytes32"}],"name":"setReferralCode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"callers","type":"address[]"},{"internalType":"bool","name":"isApproved","type":"bool"}],"name":"setWhitelistedCallers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bool","name":"isApproved","type":"bool"}],"name":"setWhitelistedTargets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newCollector","type":"address"}],"name":"updateCollector","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916100c4565b60408051600081526001600160a01b038416602082015283917fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b039283166001600160a01b03199182161790915560018054939092169216919091179055506100f7565b80516001600160a01b03811681146100bf57600080fd5b919050565b600080604083850312156100d757600080fd5b6100e0836100a8565b91506100ee602084016100a8565b90509250929050565b6108e9806101066000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063907caa0011610071578063907caa001461017b578063913e77ad146101ae5780639e69bee9146101c1578063c316c98b146101d4578063cabfa284146101e7578063f851a4401461020a57600080fd5b80631bb8c61d146100b957806323f4986e146100ce5780632d5aa3ad146100e1578063704b6c02146100f45780637e644547146101075780638d98f2701461014d575b600080fd5b6100cc6100c7366004610728565b61021d565b005b6100cc6100dc366004610728565b61031f565b6100cc6100ef366004610784565b61041b565b6100cc61010236600461079d565b6104a0565b610130610115366004610784565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61016d61015b366004610784565b60056020526000908152604090205481565b604051908152602001610144565b61019e61018936600461079d565b60026020526000908152604090205460ff1681565b6040519015158152602001610144565b600154610130906001600160a01b031681565b6100cc6101cf3660046107cd565b610534565b6100cc6101e236600461079d565b61065d565b61019e6101f536600461079d565b60036020526000908152604090205460ff1681565b600054610130906001600160a01b031681565b6000546001600160a01b031633146102485760405163b5c42b3b60e01b815260040160405180910390fd5b60005b8281101561031957816003600086868581811061026a5761026a610839565b905060200201602081019061027f919061079d565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557fb861c203756aa4c71197a24cadfd62a5844613070b3b2b305e14b7d76d29f2f08484838181106102da576102da610839565b90506020020160208101906102ef919061079d565b604080516001600160a01b03909216825284151560208301520160405180910390a160010161024b565b50505050565b6000546001600160a01b0316331461034a5760405163b5c42b3b60e01b815260040160405180910390fd5b60005b8281101561031957816002600086868581811061036c5761036c610839565b9050602002016020810190610381919061079d565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f3272521181c29632730d3de95425a9f8bb1c931b2aa64605f3ddb2623eae61c38484838181106103dc576103dc610839565b90506020020160208101906103f1919061079d565b604080516001600160a01b03909216825284151560208301520160405180910390a160010161034d565b6000818152600460205260409020546001600160a01b0316156104515760405163e55b462960e01b815260040160405180910390fd5b60008181526004602052604080822080546001600160a01b031916339081179091559051909183917f9313774a9a29c402f5880b9b8ef66b0df0bc4431f3ea75eb4b4ddcc93be6344b9190a350565b6000546001600160a01b031633146104cb5760405163b5c42b3b60e01b815260040160405180910390fd5b600054604080516001600160a01b03928316815291831660208301527fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461055f5760405163b5c42b3b60e01b815260040160405180910390fd5b82811461057f5760405163512509d360e11b815260040160405180910390fd5b60005b83811015610619576101f483838381811061059f5761059f610839565b90506020020135116105f8578282828181106105bd576105bd610839565b90506020020135600560008787858181106105da576105da610839565b90506020020135815260200190815260200160002081905550610611565b604051636b67bdaf60e11b815260040160405180910390fd5b600101610582565b507f9b698a028154cece5db8fa7b1c9b38bdb56dbcacccc30033ca01a37f7c6aa5068484848460405161064f9493929190610881565b60405180910390a150505050565b6000546001600160a01b031633146106885760405163b5c42b3b60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fa9bb408327f52d68e1e7f2aae4e85ba051f898a2d53d9e17df2f037244567bdf9060200160405180910390a150565b60008083601f8401126106ee57600080fd5b50813567ffffffffffffffff81111561070657600080fd5b6020830191508360208260051b850101111561072157600080fd5b9250929050565b60008060006040848603121561073d57600080fd5b833567ffffffffffffffff81111561075457600080fd5b610760868287016106dc565b9094509250506020840135801515811461077957600080fd5b809150509250925092565b60006020828403121561079657600080fd5b5035919050565b6000602082840312156107af57600080fd5b81356001600160a01b03811681146107c657600080fd5b9392505050565b600080600080604085870312156107e357600080fd5b843567ffffffffffffffff808211156107fb57600080fd5b610807888389016106dc565b9096509450602087013591508082111561082057600080fd5b5061082d878288016106dc565b95989497509550505050565b634e487b7160e01b600052603260045260246000fd5b81835260006001600160fb1b0383111561086857600080fd5b8260051b80836020870137939093016020019392505050565b60408152600061089560408301868861084f565b82810360208401526108a881858761084f565b97965050505050505056fea2646970667358221220586c981cc82a8d036c9de347c885d35dfe8f1d952ca114c50f28029aa54af5be64736f6c63430008130033000000000000000000000000bde48624f9e1dd4107df324d1ba3c07004640206000000000000000000000000d4627ecb405b64448ee6b07dcf860bf55590c83d
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063907caa0011610071578063907caa001461017b578063913e77ad146101ae5780639e69bee9146101c1578063c316c98b146101d4578063cabfa284146101e7578063f851a4401461020a57600080fd5b80631bb8c61d146100b957806323f4986e146100ce5780632d5aa3ad146100e1578063704b6c02146100f45780637e644547146101075780638d98f2701461014d575b600080fd5b6100cc6100c7366004610728565b61021d565b005b6100cc6100dc366004610728565b61031f565b6100cc6100ef366004610784565b61041b565b6100cc61010236600461079d565b6104a0565b610130610115366004610784565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61016d61015b366004610784565b60056020526000908152604090205481565b604051908152602001610144565b61019e61018936600461079d565b60026020526000908152604090205460ff1681565b6040519015158152602001610144565b600154610130906001600160a01b031681565b6100cc6101cf3660046107cd565b610534565b6100cc6101e236600461079d565b61065d565b61019e6101f536600461079d565b60036020526000908152604090205460ff1681565b600054610130906001600160a01b031681565b6000546001600160a01b031633146102485760405163b5c42b3b60e01b815260040160405180910390fd5b60005b8281101561031957816003600086868581811061026a5761026a610839565b905060200201602081019061027f919061079d565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557fb861c203756aa4c71197a24cadfd62a5844613070b3b2b305e14b7d76d29f2f08484838181106102da576102da610839565b90506020020160208101906102ef919061079d565b604080516001600160a01b03909216825284151560208301520160405180910390a160010161024b565b50505050565b6000546001600160a01b0316331461034a5760405163b5c42b3b60e01b815260040160405180910390fd5b60005b8281101561031957816002600086868581811061036c5761036c610839565b9050602002016020810190610381919061079d565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f3272521181c29632730d3de95425a9f8bb1c931b2aa64605f3ddb2623eae61c38484838181106103dc576103dc610839565b90506020020160208101906103f1919061079d565b604080516001600160a01b03909216825284151560208301520160405180910390a160010161034d565b6000818152600460205260409020546001600160a01b0316156104515760405163e55b462960e01b815260040160405180910390fd5b60008181526004602052604080822080546001600160a01b031916339081179091559051909183917f9313774a9a29c402f5880b9b8ef66b0df0bc4431f3ea75eb4b4ddcc93be6344b9190a350565b6000546001600160a01b031633146104cb5760405163b5c42b3b60e01b815260040160405180910390fd5b600054604080516001600160a01b03928316815291831660208301527fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461055f5760405163b5c42b3b60e01b815260040160405180910390fd5b82811461057f5760405163512509d360e11b815260040160405180910390fd5b60005b83811015610619576101f483838381811061059f5761059f610839565b90506020020135116105f8578282828181106105bd576105bd610839565b90506020020135600560008787858181106105da576105da610839565b90506020020135815260200190815260200160002081905550610611565b604051636b67bdaf60e11b815260040160405180910390fd5b600101610582565b507f9b698a028154cece5db8fa7b1c9b38bdb56dbcacccc30033ca01a37f7c6aa5068484848460405161064f9493929190610881565b60405180910390a150505050565b6000546001600160a01b031633146106885760405163b5c42b3b60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fa9bb408327f52d68e1e7f2aae4e85ba051f898a2d53d9e17df2f037244567bdf9060200160405180910390a150565b60008083601f8401126106ee57600080fd5b50813567ffffffffffffffff81111561070657600080fd5b6020830191508360208260051b850101111561072157600080fd5b9250929050565b60008060006040848603121561073d57600080fd5b833567ffffffffffffffff81111561075457600080fd5b610760868287016106dc565b9094509250506020840135801515811461077957600080fd5b809150509250925092565b60006020828403121561079657600080fd5b5035919050565b6000602082840312156107af57600080fd5b81356001600160a01b03811681146107c657600080fd5b9392505050565b600080600080604085870312156107e357600080fd5b843567ffffffffffffffff808211156107fb57600080fd5b610807888389016106dc565b9096509450602087013591508082111561082057600080fd5b5061082d878288016106dc565b95989497509550505050565b634e487b7160e01b600052603260045260246000fd5b81835260006001600160fb1b0383111561086857600080fd5b8260051b80836020870137939093016020019392505050565b60408152600061089560408301868861084f565b82810360208401526108a881858761084f565b97965050505050505056fea2646970667358221220586c981cc82a8d036c9de347c885d35dfe8f1d952ca114c50f28029aa54af5be64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000bde48624f9e1dd4107df324d1ba3c07004640206000000000000000000000000d4627ecb405b64448ee6b07dcf860bf55590c83d
-----Decoded View---------------
Arg [0] : admin_ (address): 0xBDE48624F9E1dd4107df324D1BA3C07004640206
Arg [1] : collector_ (address): 0xd4627eCb405B64448EE6B07dcf860BF55590c83D
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000bde48624f9e1dd4107df324d1ba3c07004640206
Arg [1] : 000000000000000000000000d4627ecb405b64448ee6b07dcf860bf55590c83d

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.