Overview
S Balance
0 S
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
WhitelistRegistry
Compiler Version
v0.8.12+commit.f00d7308
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.12; import "./interfaces/IWhitelistRegistry.sol"; contract WhitelistRegistry is IWhitelistRegistry { /** * @dev info, per address, of permissions. 0 = no permissions, 1 = whitelisted. This is only relevant for vaults with whitelists. */ mapping(address => mapping(address => uint256)) public permissions; mapping(address => address) public whitelistManagers; /** * @dev add whitelist permissions for any number of addresses. * @param _vaultAddress the vault whose whitelist will be edited * @param _addresses the addresses to be added to the whitelist */ function addPermissions( address _vaultAddress, address[] calldata _addresses ) external { // Make sure caller is authorized require( msg.sender == whitelistManagers[_vaultAddress], "Only Whitelist Manager" ); mapping(address => uint256) storage _permissions = permissions[ _vaultAddress ]; // Add permissions uint256 addressCount = _addresses.length; for (uint256 i; i != addressCount; ++i) { _permissions[_addresses[i]] = 1; } emit PermissionsAdded(msg.sender, _vaultAddress, _addresses); } /** * @dev function meant to be called by contracts (usually in initializer) to register a whitelist manager for that contract * @param manager the address of the vault's whitelist manager * No access control, since any given contract can only modify their own data here. */ function registerWhitelistManager(address manager) external { whitelistManagers[msg.sender] = manager; emit ManagerAdded(msg.sender, manager); } /** * @dev add whitelist permissions for any number of addresses. * @param _vaultAddress the vault whose whitelist will be edited * @param _addresses the addresses to be removed from the whitelist */ function revokePermissions( address _vaultAddress, address[] calldata _addresses ) external { // Make sure caller is authorized require( msg.sender == whitelistManagers[_vaultAddress], "Only Whitelist Manager" ); mapping(address => uint256) storage _permissions = permissions[ _vaultAddress ]; // Add permissions uint256 addressCount = _addresses.length; for (uint256 i; i != addressCount; ++i) { _permissions[_addresses[i]] = 0; } emit PermissionsRemoved(msg.sender, _vaultAddress, _addresses); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.12; interface IWhitelistRegistry { event PermissionsAdded( address whitelistManager, address vault, address[] addressesAdded ); event PermissionsRemoved( address whitelistManager, address vault, address[] addressesRemoved ); event ManagerAdded(address vaultAddress, address manager); function addPermissions( address _vaultAddress, address[] calldata _addresses ) external; function registerWhitelistManager(address manager) external; function revokePermissions( address _vaultAddress, address[] calldata _addresses ) external; }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 10 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vaultAddress","type":"address"},{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"ManagerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"whitelistManager","type":"address"},{"indexed":false,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"address[]","name":"addressesAdded","type":"address[]"}],"name":"PermissionsAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"whitelistManager","type":"address"},{"indexed":false,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"address[]","name":"addressesRemoved","type":"address[]"}],"name":"PermissionsRemoved","type":"event"},{"inputs":[{"internalType":"address","name":"_vaultAddress","type":"address"},{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"addPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"permissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"manager","type":"address"}],"name":"registerWhitelistManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vaultAddress","type":"address"},{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"revokePermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistManagers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50610561806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630773e6ba1461005c5780631f9838b51461007157806331e8e0a2146100ac57806380300623146100ed578063ed316ad914610100575b600080fd5b61006f61006a36600461037d565b610113565b005b61009961007f366004610402565b600060208181529281526040808220909352908152205481565b6040519081526020015b60405180910390f35b6100d56100ba366004610435565b6001602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016100a3565b61006f6100fb36600461037d565b610213565b61006f61010e366004610435565b6102fb565b6001600160a01b038381166000908152600160205260409020541633146101555760405162461bcd60e51b815260040161014c90610457565b60405180910390fd5b6001600160a01b03831660009081526020819052604081209082905b8181146101ce57600183600087878581811061018f5761018f610487565b90506020020160208101906101a49190610435565b6001600160a01b031681526020810191909152604001600020556101c78161049d565b9050610171565b507fd5ae75a4db3730e774830e7c64b00258bd9b241c6042829e01eeb1596ccd200b3386868660405161020494939291906104c6565b60405180910390a15050505050565b6001600160a01b0383811660009081526001602052604090205416331461024c5760405162461bcd60e51b815260040161014c90610457565b6001600160a01b03831660009081526020819052604081209082905b8181146102c557600083600087878581811061028657610286610487565b905060200201602081019061029b9190610435565b6001600160a01b031681526020810191909152604001600020556102be8161049d565b9050610268565b507ffa59fdd7b076c65cfaf469a2ad3da44044ca6a834b1d4f536a09c6bbdfefff083386868660405161020494939291906104c6565b3360008181526001602090815260409182902080546001600160a01b0319166001600160a01b0386169081179091558251938452908301527f05a4006f300442cf8b7fdb885f5ee958812020bffb5c5a8e655fde64e5f987ed910160405180910390a150565b80356001600160a01b038116811461037857600080fd5b919050565b60008060006040848603121561039257600080fd5b61039b84610361565b925060208401356001600160401b03808211156103b757600080fd5b818601915086601f8301126103cb57600080fd5b8135818111156103da57600080fd5b8760208260051b85010111156103ef57600080fd5b6020830194508093505050509250925092565b6000806040838503121561041557600080fd5b61041e83610361565b915061042c60208401610361565b90509250929050565b60006020828403121561044757600080fd5b61045082610361565b9392505050565b60208082526016908201527527b7363c902bb434ba32b634b9ba1026b0b730b3b2b960511b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156104bf57634e487b7160e01b600052601160045260246000fd5b5060010190565b6001600160a01b0385811682528481166020808401919091526060604084018190528301849052600091859160808501845b8781101561051d578361050a86610361565b16825293820193908201906001016104f8565b50999850505050505050505056fea2646970667358221220456a474e9225754a7063d53e5803643ebab3da13bf39335fa7cca59b0b4c888564736f6c634300080c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c80630773e6ba1461005c5780631f9838b51461007157806331e8e0a2146100ac57806380300623146100ed578063ed316ad914610100575b600080fd5b61006f61006a36600461037d565b610113565b005b61009961007f366004610402565b600060208181529281526040808220909352908152205481565b6040519081526020015b60405180910390f35b6100d56100ba366004610435565b6001602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016100a3565b61006f6100fb36600461037d565b610213565b61006f61010e366004610435565b6102fb565b6001600160a01b038381166000908152600160205260409020541633146101555760405162461bcd60e51b815260040161014c90610457565b60405180910390fd5b6001600160a01b03831660009081526020819052604081209082905b8181146101ce57600183600087878581811061018f5761018f610487565b90506020020160208101906101a49190610435565b6001600160a01b031681526020810191909152604001600020556101c78161049d565b9050610171565b507fd5ae75a4db3730e774830e7c64b00258bd9b241c6042829e01eeb1596ccd200b3386868660405161020494939291906104c6565b60405180910390a15050505050565b6001600160a01b0383811660009081526001602052604090205416331461024c5760405162461bcd60e51b815260040161014c90610457565b6001600160a01b03831660009081526020819052604081209082905b8181146102c557600083600087878581811061028657610286610487565b905060200201602081019061029b9190610435565b6001600160a01b031681526020810191909152604001600020556102be8161049d565b9050610268565b507ffa59fdd7b076c65cfaf469a2ad3da44044ca6a834b1d4f536a09c6bbdfefff083386868660405161020494939291906104c6565b3360008181526001602090815260409182902080546001600160a01b0319166001600160a01b0386169081179091558251938452908301527f05a4006f300442cf8b7fdb885f5ee958812020bffb5c5a8e655fde64e5f987ed910160405180910390a150565b80356001600160a01b038116811461037857600080fd5b919050565b60008060006040848603121561039257600080fd5b61039b84610361565b925060208401356001600160401b03808211156103b757600080fd5b818601915086601f8301126103cb57600080fd5b8135818111156103da57600080fd5b8760208260051b85010111156103ef57600080fd5b6020830194508093505050509250925092565b6000806040838503121561041557600080fd5b61041e83610361565b915061042c60208401610361565b90509250929050565b60006020828403121561044757600080fd5b61045082610361565b9392505050565b60208082526016908201527527b7363c902bb434ba32b634b9ba1026b0b730b3b2b960511b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156104bf57634e487b7160e01b600052601160045260246000fd5b5060010190565b6001600160a01b0385811682528481166020808401919091526060604084018190528301849052600091859160808501845b8781101561051d578361050a86610361565b16825293820193908201906001016104f8565b50999850505050505050505056fea2646970667358221220456a474e9225754a7063d53e5803643ebab3da13bf39335fa7cca59b0b4c888564736f6c634300080c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.