Contract Overview
Balance:
0 ETH
My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x3751f66a791075ee6e7c1dd769e68a445945c2364a86eb011667c4b5a193c7fa | 0x60806040 | 12484966 | 60 days 23 hrs ago | 0xc625f59d51ecdff57fefe535c80d318ca42a0ec4 | IN | Create: Settings | 0 ETH | 0.001414002743 |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
Settings
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.18; import {ISettings} from "src/interfaces/ISettings.sol"; import {Owned} from "src/utils/Owned.sol"; /// @title Kwenta Smart Margin Account Settings /// @author JaredBorders ([email protected]) /// @notice This contract is used to manage the settings of the Kwenta Smart Margin Account /// @custom:caution Changes to this contract will effectively clear any existing settings. /// Post update, the owner will need to reconfigure the settings either in the deploy script or /// via the Settings contract constructor. contract Settings is ISettings, Owned { /*////////////////////////////////////////////////////////////// STATE //////////////////////////////////////////////////////////////*/ /// @inheritdoc ISettings bool public accountExecutionEnabled = true; /// @inheritdoc ISettings uint256 public executorFee = 1 ether / 1000; /// @notice mapping of whitelisted tokens available for swapping via uniswap commands mapping(address => bool) internal _whitelistedTokens; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /// @notice constructs the Settings contract /// @param _owner: address of the owner of the contract constructor(address _owner) Owned(_owner) {} /*////////////////////////////////////////////////////////////// VIEWS //////////////////////////////////////////////////////////////*/ /// @inheritdoc ISettings function isTokenWhitelisted(address _token) external view override returns (bool) { return _whitelistedTokens[_token]; } /*////////////////////////////////////////////////////////////// SETTERS //////////////////////////////////////////////////////////////*/ /// @inheritdoc ISettings function setAccountExecutionEnabled(bool _enabled) external override onlyOwner { accountExecutionEnabled = _enabled; emit AccountExecutionEnabledSet(_enabled); } /// @inheritdoc ISettings function setExecutorFee(uint256 _executorFee) external override onlyOwner { executorFee = _executorFee; emit ExecutorFeeSet(_executorFee); } /// @inheritdoc ISettings function setTokenWhitelistStatus(address _token, bool _isWhitelisted) external override onlyOwner { _whitelistedTokens[_token] = _isWhitelisted; emit TokenWhitelistStatusUpdated(_token, _isWhitelisted); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.18; /// @title Kwenta Smart Margin Account Settings Interface /// @author JaredBorders ([email protected]) interface ISettings { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ /// @notice emitted when account execution is enabled or disabled /// @param enabled: true if account execution is enabled, false if disabled event AccountExecutionEnabledSet(bool enabled); /// @notice emitted when the executor fee is updated /// @param executorFee: the executor fee event ExecutorFeeSet(uint256 executorFee); /// @notice emitted when a token is added to or removed from the whitelist /// @param token: address of the token /// @param isWhitelisted: true if token is whitelisted, false if not event TokenWhitelistStatusUpdated(address token, bool isWhitelisted); /*////////////////////////////////////////////////////////////// VIEWS //////////////////////////////////////////////////////////////*/ /// @notice checks if account execution is enabled or disabled /// @return enabled: true if account execution is enabled, false if disabled function accountExecutionEnabled() external view returns (bool); /// @notice gets the conditional order executor fee /// @return executorFee: the executor fee function executorFee() external view returns (uint256); /// @notice checks if token is whitelisted /// @param _token: address of the token to check /// @return true if token is whitelisted, false if not function isTokenWhitelisted(address _token) external view returns (bool); /*////////////////////////////////////////////////////////////// SETTERS //////////////////////////////////////////////////////////////*/ /// @notice enables or disables account execution /// @param _enabled: true if account execution is enabled, false if disabled function setAccountExecutionEnabled(bool _enabled) external; /// @notice sets the conditional order executor fee /// @param _executorFee: the executor fee function setExecutorFee(uint256 _executorFee) external; /// @notice adds/removes token to/from whitelist /// @dev does not check if token was previously whitelisted /// @param _token: address of the token to add /// @param _isWhitelisted: true if token is to be whitelisted, false if not function setTokenWhitelistStatus(address _token, bool _isWhitelisted) external; }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.18; /// @notice Simple single owner authorization mixin. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol) abstract contract Owned { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event OwnershipTransferred(address indexed user, address indexed newOwner); /*////////////////////////////////////////////////////////////// OWNERSHIP STORAGE //////////////////////////////////////////////////////////////*/ address public owner; modifier onlyOwner() virtual { require(msg.sender == owner, "UNAUTHORIZED"); _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(address _owner) { owner = _owner; emit OwnershipTransferred(address(0), _owner); } /*////////////////////////////////////////////////////////////// OWNERSHIP LOGIC //////////////////////////////////////////////////////////////*/ function transferOwnership(address newOwner) public virtual onlyOwner { owner = newOwner; emit OwnershipTransferred(msg.sender, newOwner); } }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 1000000 }, "metadata": { "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"AccountExecutionEnabledSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"executorFee","type":"uint256"}],"name":"ExecutorFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"isWhitelisted","type":"bool"}],"name":"TokenWhitelistStatusUpdated","type":"event"},{"inputs":[],"name":"accountExecutionEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"executorFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"isTokenWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setAccountExecutionEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_executorFee","type":"uint256"}],"name":"setExecutorFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_isWhitelisted","type":"bool"}],"name":"setTokenWhitelistStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526000805460ff60a01b1916600160a01b17905566038d7ea4c6800060015534801561002e57600080fd5b5060405161073d38038061073d83398101604081905261004d9161009c565b600080546001600160a01b0319166001600160a01b03831690811782556040518392907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350506100cc565b6000602082840312156100ae57600080fd5b81516001600160a01b03811681146100c557600080fd5b9392505050565b610662806100db6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b14610106578063b5af090f1461014b578063ebb5723814610184578063f2fde38b1461019757600080fd5b8063062af0b01461008d578063125127b3146100a95780637e8d7245146100de5780638010faca146100f3575b600080fd5b61009660015481565b6040519081526020015b60405180910390f35b6000546100ce9074010000000000000000000000000000000000000000900460ff1681565b60405190151581526020016100a0565b6100f16100ec36600461057f565b6101aa565b005b6100f16101013660046105c5565b6102b4565b6000546101269073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100a0565b6100ce6101593660046105f8565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205460ff1690565b6100f1610192366004610613565b6103c3565b6100f16101a53660046105f8565b610479565b60005473ffffffffffffffffffffffffffffffffffffffff163314610230576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6000805482151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9091161790556040517f8d6f261c44da2e77cf0823a5ea4c93cceedad6f037f0ce7ee4be3575baab944d906102a990831515815260200190565b60405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff163314610335576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610227565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168515159081179091558251938452908301527fb913ce092ad70ab4289ac16f73c878fa699fa3c02b122d593d29fb0fe73c352b910160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610227565b60018190556040518181527fad1606d0d14ba44f6f1342eab97c390c269a0918ad22773094b8c14037d78e58906020016102a9565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610227565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b8035801515811461057a57600080fd5b919050565b60006020828403121561059157600080fd5b61059a8261056a565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461057a57600080fd5b600080604083850312156105d857600080fd5b6105e1836105a1565b91506105ef6020840161056a565b90509250929050565b60006020828403121561060a57600080fd5b61059a826105a1565b60006020828403121561062557600080fd5b503591905056fea264697066735822122049b318df81c5db67ab297a35ee19af539e6e2de393756a4dde7f3c1f5d4afdc664736f6c63430008120033000000000000000000000000c625f59d51ecdff57fefe535c80d318ca42a0ec4
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c625f59d51ecdff57fefe535c80d318ca42a0ec4
-----Decoded View---------------
Arg [0] : _owner (address): 0xc625F59d51ecDff57FEFE535C80d318CA42A0Ec4
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000c625f59d51ecdff57fefe535c80d318ca42a0ec4