Contract Overview
Balance:
0 FTM
FTM Value:
$0.00
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Latest 1 internal transaction
Parent Txn Hash | Block | From | To | Value | |||
---|---|---|---|---|---|---|---|
0x5bca3bb7dd3aacf3721d359d651ed8274d0cc29c3b43c9a5730e8058fb267b03 | 18767268 | 536 days 16 hrs ago | Dark Matter DeFi: Deployer | Contract Creation | 0 FTM |
[ Download CSV Export ]
Contract Name:
DeflationController
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 8500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; contract DeflationController is Ownable { using SafeMath for uint256; uint256 public eoaFee = 35; // default burn for EOA 0.35% uint256 public defFee = 69; // default burn for nonEOA 0.69% uint256 constant public MAX_DEFLATION_ALLOWED = 1000; // 10% event SetRule(address indexed _address,uint256 _senderFee,uint256 _callerFee,uint256 _recipientFee); event SetRuleStatus(address indexed _address,bool _status); event SetEoaFee(uint256 eoaFee); event SetDefFee(uint256 defFee); //deflation rule struct DeflationRule { uint256 senderFee; uint256 callerFee; uint256 recipientFee; bool active; } mapping (address => DeflationRule ) public rules; /** * Check burn amount following DeflationRule, returns how much amount will be burned * * */ function checkDeflation(address origin,address caller,address _from,address recipient, uint256 amount) external view returns (uint256){ uint256 burnAmount = 0; DeflationRule memory fromRule = rules[_from]; DeflationRule memory callerRule = rules[caller]; DeflationRule memory recipientRule = rules[recipient]; //check transfers and transferFrom to/from caller but not fransferfrom to diferent recipient if(callerRule.active && callerRule.callerFee>0){ //default caller rule fee burnAmount = burnAmount.add(amount.mul(callerRule.callerFee).div(10000)); } // check transfer/TransferFrom from any caller to a selected recipient if(recipientRule.active && recipientRule.recipientFee>0){ burnAmount = burnAmount.add(amount.mul(recipientRule.recipientFee).div(10000)); } // check fr0m fee from a selected from if(fromRule.active && fromRule.senderFee>0){ burnAmount = burnAmount.add(amount.mul(fromRule.senderFee).div(10000)); } //normal transfer and transferFrom from eoa (called directly) if( burnAmount==0 && origin==caller && eoaFee>0 && !callerRule.active && !recipientRule.active && !fromRule.active) { burnAmount = burnAmount.add(amount.mul(eoaFee).div(10000)); //no burn because no rules on that tx, setUp default burn }else if(burnAmount==0 && origin!=caller && defFee>0 && !callerRule.active && !recipientRule.active && !fromRule.active) { burnAmount = burnAmount.add(amount.mul(defFee).div(10000)); } return burnAmount; } function setRule(address _address,uint256 _senderFee,uint256 _callerFee,uint256 _recipientFee,bool _active) external onlyOwner { require(_senderFee<=MAX_DEFLATION_ALLOWED && _callerFee<=MAX_DEFLATION_ALLOWED && _recipientFee <= MAX_DEFLATION_ALLOWED ); rules[_address] = DeflationRule({ senderFee : _senderFee, callerFee:_callerFee, recipientFee:_recipientFee, active : _active }); emit SetRule(_address,_senderFee,_callerFee,_recipientFee); emit SetRuleStatus(_address,_active); } function setRuleStatus(address _address,bool _active) external onlyOwner { rules[_address].active=_active; emit SetRuleStatus(_address,_active); } function setEoaFee(uint256 _eoaFee) external onlyOwner { require(_eoaFee<=MAX_DEFLATION_ALLOWED); eoaFee = _eoaFee; emit SetEoaFee(_eoaFee); } function setDefFee(uint256 _defFee) external onlyOwner { require(_defFee<=MAX_DEFLATION_ALLOWED); defFee = _defFee; emit SetDefFee(_defFee); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../GSN/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
{ "optimizer": { "enabled": true, "runs": 8500 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"defFee","type":"uint256"}],"name":"SetDefFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"eoaFee","type":"uint256"}],"name":"SetEoaFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"uint256","name":"_senderFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_callerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_recipientFee","type":"uint256"}],"name":"SetRule","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"SetRuleStatus","type":"event"},{"inputs":[],"name":"MAX_DEFLATION_ALLOWED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"origin","type":"address"},{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"checkDeflation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eoaFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rules","outputs":[{"internalType":"uint256","name":"senderFee","type":"uint256"},{"internalType":"uint256","name":"callerFee","type":"uint256"},{"internalType":"uint256","name":"recipientFee","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_defFee","type":"uint256"}],"name":"setDefFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_eoaFee","type":"uint256"}],"name":"setEoaFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_senderFee","type":"uint256"},{"internalType":"uint256","name":"_callerFee","type":"uint256"},{"internalType":"uint256","name":"_recipientFee","type":"uint256"},{"internalType":"bool","name":"_active","type":"bool"}],"name":"setRule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_active","type":"bool"}],"name":"setRuleStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526023600155604560025534801561001a57600080fd5b506000610025610074565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350610078565b3390565b610f3e806100876000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806388b19dcc11610081578063988144e81161005b578063988144e81461029e578063ae7eac87146102a6578063f2fde38b146102ae576100d4565b806388b19dcc146101df5780638da5cb5b146102325780638edbd8a414610263576100d4565b8063715018a6116100b2578063715018a6146101a057806379aa3657146101a8578063814e9d75146101c2576100d4565b806307c9ffb1146100d95780633c93c031146100f85780634f38ed6d14610153575b600080fd5b6100f6600480360360208110156100ef57600080fd5b50356102e1565b005b61012b6004803603602081101561010e57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166103a2565b6040805194855260208501939093528383019190915215156060830152519081900360800190f35b6100f6600480360360a081101561016957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020810135906040810135906060810135906080013515156103ce565b6100f6610594565b6101b061067a565b60408051918252519081900360200190f35b6100f6600480360360208110156101d857600080fd5b5035610680565b6101b0600480360360a08110156101f557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135821691604082013581169160608101359091169060800135610741565b61023a610a70565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100f66004803603604081101561027957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001351515610a8c565b6101b0610b91565b6101b0610b97565b6100f6600480360360208110156102c457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b9d565b6102e9610cf3565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610358576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6103e881111561036757600080fd5b60028190556040805182815290517fa4e474e47c8fb6e8737fdf1480fb78d3729ff5b6476d11ff6e2671610cda73779181900360200190a150565b600360208190526000918252604090912080546001820154600283015492909301549092919060ff1684565b6103d6610cf3565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610445576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6103e8841115801561045957506103e88311155b801561046757506103e88211155b61047057600080fd5b604080516080810182528581526020808201868152828401868152851515606080860191825273ffffffffffffffffffffffffffffffffffffffff8c16600081815260038088529089902097518855945160018801559251600287015590519490920180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016941515949094179093558351888152918201879052818401869052925191927f5b5ceea0847949ba7651f7a77f3311f0597356389ce695792521a93fc33782c792918290030190a2604080518215158152905173ffffffffffffffffffffffffffffffffffffffff8716917f9478da8c6959eb53cb78ed76bd90583827d20f620091f6c1addaa46072e2495b919081900360200190a25050505050565b61059c610cf3565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461060b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60025481565b610688610cf3565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146106f7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6103e881111561070657600080fd5b60018190556040805182815290517f92cebf6e751cb82de789195d8544f1ca15ec859d35b05c71e5123ca27948959f9181900360200190a150565b60008061074c610e97565b5073ffffffffffffffffffffffffffffffffffffffff851660009081526003602081815260409283902083516080810185528154815260018201549281019290925260028101549382019390935291015460ff16151560608201526107af610e97565b5073ffffffffffffffffffffffffffffffffffffffff871660009081526003602081815260409283902083516080810185528154815260018201549281019290925260028101549382019390935291015460ff1615156060820152610812610e97565b5073ffffffffffffffffffffffffffffffffffffffff861660009081526003602081815260409283902083516080810185528154815260018201549281019290925260028101549382019390935291015460ff1615156060808301919091528201518015610884575060008260200151115b156108b9576108b66108af6127106108a985602001518a610cf790919063ffffffff16565b90610d59565b8590610d9b565b93505b806060015180156108ce575060008160400151115b156108f6576108f36108af6127106108a984604001518a610cf790919063ffffffff16565b93505b826060015180156109075750825115155b1561092f5761092c6108af6127106108a986600001518a610cf790919063ffffffff16565b93505b8315801561096857508873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16145b801561097657506000600154115b801561098457508160600151155b801561099257508060600151155b80156109a057508260600151155b156109ca576109c36108af6127106108a96001548a610cf790919063ffffffff16565b9350610a62565b83158015610a0457508873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b8015610a1257506000600254115b8015610a2057508160600151155b8015610a2e57508060600151155b8015610a3c57508260600151155b15610a6257610a5f6108af6127106108a96002548a610cf790919063ffffffff16565b93505b509198975050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b610a94610cf3565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610b03576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660008181526003602081815260409283902090910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016851515908117909155825190815291517f9478da8c6959eb53cb78ed76bd90583827d20f620091f6c1addaa46072e2495b9281900390910190a25050565b6103e881565b60015481565b610ba5610cf3565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610c14576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116610c665760405162461bcd60e51b8152600401808060200182810382526026815260200180610ec26026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b3390565b600082610d0657506000610d53565b82820282848281610d1357fe5b0414610d505760405162461bcd60e51b8152600401808060200182810382526021815260200180610ee86021913960400191505060405180910390fd5b90505b92915050565b6000610d5083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610df5565b600082820183811015610d50576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008183610e815760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e46578181015183820152602001610e2e565b50505050905090810190601f168015610e735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610e8d57fe5b0495945050505050565b6040518060800160405280600081526020016000815260200160008152602001600015158152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122083a676c1d2f21f3715cdb8d5f031a32f1d527d6ca5bb4bc60694b05931f48a6e64736f6c634300060c0033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Validator ID :
0 FTM
Amount Staked
0
Amount Delegated
0
Staking Total
0
Staking Start Epoch
0
Staking Start Time
0
Proof of Importance
0
Origination Score
0
Validation Score
0
Active
0
Online
0
Downtime
0 s
Address | Amount | claimed Rewards | Created On Epoch | Created On |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.