Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 5 from a total of 5 transactions
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
TradingClasses
Compiler Version
v0.4.25+commit.59dbf8f1
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2019-09-05
*/
// File: contracts/wallet_trading_limiter/interfaces/ITradingClasses.sol
pragma solidity 0.4.25;
/**
* @title Trading Classes Interface.
*/
interface ITradingClasses {
/**
* @dev Get the limit of a class.
* @param _id The id of the class.
* @return The limit of the class.
*/
function getLimit(uint256 _id) external view returns (uint256);
}
// File: openzeppelin-solidity-v1.12.0/contracts/ownership/Ownable.sol
pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: openzeppelin-solidity-v1.12.0/contracts/ownership/Claimable.sol
pragma solidity ^0.4.24;
/**
* @title Claimable
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
* This allows the new owner to accept the transfer.
*/
contract Claimable is Ownable {
address public pendingOwner;
/**
* @dev Modifier throws if called by any account other than the pendingOwner.
*/
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
/**
* @dev Allows the current owner to set the pendingOwner address.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
pendingOwner = newOwner;
}
/**
* @dev Allows the pendingOwner address to finalize the transfer.
*/
function claimOwnership() public onlyPendingOwner {
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = address(0);
}
}
// File: contracts/wallet_trading_limiter/TradingClasses.sol
pragma solidity 0.4.25;
/**
* Details of usage of licenced software see here: https://www.saga.org/software/readme_v1
*/
/**
* @title Trading Classes.
*/
contract TradingClasses is ITradingClasses, Claimable {
string public constant VERSION = "1.0.0";
uint256[] public array;
struct Info {
uint256 limit;
uint256 index;
}
mapping(uint256 => Info) public table;
enum Action {None, Insert, Update, Remove}
event ActionCompleted(uint256 _id, uint256 _limit, Action _action);
/**
* @dev Get the limit of a class.
* @param _id The id of the class.
* @return The limit of the class.
*/
function getLimit(uint256 _id) external view returns (uint256) {
return table[_id].limit;
}
/**
* @dev Set the limit of a class.
* @param _id The id of the class.
* @param _limit The limit of the class.
*/
function setLimit(uint256 _id, uint256 _limit) external onlyOwner {
Info storage info = table[_id];
Action action = getAction(info.limit, _limit);
if (action == Action.Insert) {
info.index = array.length;
info.limit = _limit;
array.push(_id);
}
else if (action == Action.Update) {
info.limit = _limit;
}
else if (action == Action.Remove) {
// at this point we know that array.length > info.index >= 0
uint256 last = array[array.length - 1]; // will never underflow
table[last].index = info.index;
array[info.index] = last;
array.length -= 1; // will never underflow
delete table[_id];
}
emit ActionCompleted(_id, _limit, action);
}
/**
* @dev Get an array of all the classes.
* @return An array of all the classes.
*/
function getArray() external view returns (uint256[] memory) {
return array;
}
/**
* @dev Get the total number of classes.
* @return The total number of classes.
*/
function getCount() external view returns (uint256) {
return array.length;
}
/**
* @dev Get the required action.
* @param _prev The old limit.
* @param _next The new limit.
* @return The required action.
*/
function getAction(uint256 _prev, uint256 _next) private pure returns (Action) {
if (_prev == 0 && _next != 0)
return Action.Insert;
if (_prev != 0 && _next == 0)
return Action.Remove;
if (_prev != _next)
return Action.Update;
return Action.None;
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_limit","type":"uint256"}],"name":"setLimit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"array","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"claimOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getLimit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"table","outputs":[{"name":"limit","type":"uint256"},{"name":"index","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getArray","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"VERSION","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_id","type":"uint256"},{"indexed":false,"name":"_limit","type":"uint256"},{"indexed":false,"name":"_action","type":"uint8"}],"name":"ActionCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]Contract Creation Code
608060405260008054600160a060020a03191633179055610880806100256000396000f3006080604052600436106100b95763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663207add9181146100be57806338d94193146100db5780634e71e0c814610105578063715018a61461011a578063827d63201461012f5780638da5cb5b14610147578063a87d942c14610185578063bafff8c01461019a578063d504ea1d146101cb578063e30c397814610230578063f2fde38b14610245578063ffa1ad7414610273575b600080fd5b3480156100ca57600080fd5b506100d96004356024356102fd565b005b3480156100e757600080fd5b506100f36004356104f0565b60408051918252519081900360200190f35b34801561011157600080fd5b506100d961050f565b34801561012657600080fd5b506100d96105c9565b34801561013b57600080fd5b506100f360043561065a565b34801561015357600080fd5b5061015c61066c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561019157600080fd5b506100f3610688565b3480156101a657600080fd5b506101b260043561068f565b6040805192835260208301919091528051918290030190f35b3480156101d757600080fd5b506101e06106a8565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561021c578181015183820152602001610204565b505050509050019250505060405180910390f35b34801561023c57600080fd5b5061015c610700565b34801561025157600080fd5b506100d973ffffffffffffffffffffffffffffffffffffffff6004351661071c565b34801561027f57600080fd5b50610288610787565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102c25781810151838201526020016102aa565b50505050905090810190601f1680156102ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600080548190819073ffffffffffffffffffffffffffffffffffffffff16331461032657600080fd5b6000858152600360205260409020805490935061034390856107be565b9150600182600381111561035357fe5b14156103a05760028054600180860191909155858555815490810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01859055610494565b60028260038111156103ae57fe5b14156103bc57838355610494565b60038260038111156103ca57fe5b141561049457600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061040057fe5b9060005260206000200154905082600101546003600083815260200190815260200160002060010181905550806002846001015481548110151561044057fe5b600091825260209091200155600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019061047d908261080d565b506000858152600360205260408120818155600101555b7f52f3bc3585edfee21088769db7d0db55b75b4b5b5e4fa6d6c7abf1b42139cc22858584604051808481526020018381526020018260038111156104d457fe5b60ff168152602001935050505060405180910390a15050505050565b60028054829081106104fe57fe5b600091825260209091200154905081565b60015473ffffffffffffffffffffffffffffffffffffffff16331461053357600080fd5b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105ed57600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a2600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60009081526003602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6002545b90565b6003602052600090815260409020805460019091015482565b606060028054806020026020016040519081016040528092919081815260200182805480156106f657602002820191906000526020600020905b8154815260200190600101908083116106e2575b5050505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff16331461074057600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60408051808201909152600581527f312e302e30000000000000000000000000000000000000000000000000000000602082015281565b6000821580156107cd57508115155b156107da57506001610807565b82158015906107e7575081155b156107f457506003610807565b82821461080357506002610807565b5060005b92915050565b81548183558181111561083157600083815260209020610831918101908301610836565b505050565b61068c91905b80821115610850576000815560010161083c565b50905600a165627a7a72305820a4abafbe946fb93bc84221d4d3cd5d609499327db4019d43069616f110a0ead90029
Deployed Bytecode
0x6080604052600436106100b95763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663207add9181146100be57806338d94193146100db5780634e71e0c814610105578063715018a61461011a578063827d63201461012f5780638da5cb5b14610147578063a87d942c14610185578063bafff8c01461019a578063d504ea1d146101cb578063e30c397814610230578063f2fde38b14610245578063ffa1ad7414610273575b600080fd5b3480156100ca57600080fd5b506100d96004356024356102fd565b005b3480156100e757600080fd5b506100f36004356104f0565b60408051918252519081900360200190f35b34801561011157600080fd5b506100d961050f565b34801561012657600080fd5b506100d96105c9565b34801561013b57600080fd5b506100f360043561065a565b34801561015357600080fd5b5061015c61066c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561019157600080fd5b506100f3610688565b3480156101a657600080fd5b506101b260043561068f565b6040805192835260208301919091528051918290030190f35b3480156101d757600080fd5b506101e06106a8565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561021c578181015183820152602001610204565b505050509050019250505060405180910390f35b34801561023c57600080fd5b5061015c610700565b34801561025157600080fd5b506100d973ffffffffffffffffffffffffffffffffffffffff6004351661071c565b34801561027f57600080fd5b50610288610787565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102c25781810151838201526020016102aa565b50505050905090810190601f1680156102ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600080548190819073ffffffffffffffffffffffffffffffffffffffff16331461032657600080fd5b6000858152600360205260409020805490935061034390856107be565b9150600182600381111561035357fe5b14156103a05760028054600180860191909155858555815490810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01859055610494565b60028260038111156103ae57fe5b14156103bc57838355610494565b60038260038111156103ca57fe5b141561049457600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061040057fe5b9060005260206000200154905082600101546003600083815260200190815260200160002060010181905550806002846001015481548110151561044057fe5b600091825260209091200155600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019061047d908261080d565b506000858152600360205260408120818155600101555b7f52f3bc3585edfee21088769db7d0db55b75b4b5b5e4fa6d6c7abf1b42139cc22858584604051808481526020018381526020018260038111156104d457fe5b60ff168152602001935050505060405180910390a15050505050565b60028054829081106104fe57fe5b600091825260209091200154905081565b60015473ffffffffffffffffffffffffffffffffffffffff16331461053357600080fd5b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105ed57600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a2600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60009081526003602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6002545b90565b6003602052600090815260409020805460019091015482565b606060028054806020026020016040519081016040528092919081815260200182805480156106f657602002820191906000526020600020905b8154815260200190600101908083116106e2575b5050505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff16331461074057600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60408051808201909152600581527f312e302e30000000000000000000000000000000000000000000000000000000602082015281565b6000821580156107cd57508115155b156107da57506001610807565b82158015906107e7575081155b156107f457506003610807565b82821461080357506002610807565b5060005b92915050565b81548183558181111561083157600083815260209020610831918101908301610836565b505050565b61068c91905b80821115610850576000815560010161083c565b50905600a165627a7a72305820a4abafbe946fb93bc84221d4d3cd5d609499327db4019d43069616f110a0ead90029
Deployed Bytecode Sourcemap
3492:2548:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4273:847;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4273:847:0;;;;;;;;;3602:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3602:22:0;;;;;;;;;;;;;;;;;;;;;3080:168;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3080:168:0;;;;1507:114;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1507:114:0;;;;4017:105;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4017:105:0;;;;;712:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;712:20:0;;;;;;;;;;;;;;;;;;;;;;;5446:90;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5446:90:0;;;;3709:37;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3709:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5237:92;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5237:92:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;5237:92:0;;;;;;;;;;;;;;;;;2531:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2531:27:0;;;;2893:98;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2893:98:0;;;;;;;3553:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3553:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3553:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4273:847;4350:17;1215:5;;4350:17;;;;1215:5;;1201:10;:19;1193:28;;;;;;4370:10;;;;:5;:10;;;;;4417;;4370;;-1:-1:-1;4407:29:0;;4429:6;4407:9;:29::i;:::-;4391:45;-1:-1:-1;4461:13:0;4451:6;:23;;;;;;;;;4447:614;;;4504:5;:12;;4491:10;;;;:25;;;;4531:19;;;27:10:-1;;23:18;;;45:23;;4531:10:0;4565:15;;;;;;;;;4447:614;;;4621:13;4611:6;:23;;;;;;;;;4607:454;;;4651:19;;;4607:454;;;4711:13;4701:6;:23;;;;;;;;;4697:364;;;4830:5;4836:12;;:16;;;;4830:23;;;;;;;;;;;;;;4815:38;;4912:4;:10;;;4892:5;:11;4898:4;4892:11;;;;;;;;;;;:17;;:30;;;;4957:4;4937:5;4943:4;:10;;;4937:17;;;;;;;;;;;;;;;;;;;:24;4976:5;:17;;;;;;;;;:::i;:::-;-1:-1:-1;5039:10:0;;;;:5;:10;;;;;5032:17;;;;;;4697:364;5076:36;5092:3;5097:6;5105;5076:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4273:847;;;;;:::o;3602:22::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3602:22:0;:::o;3080:168::-;2717:12;;;;2703:10;:26;2695:35;;;;;;3170:12;;;3163:5;;3142:41;;3170:12;;;;;3163:5;;;;3142:41;;;3198:12;;;;3190:20;;;;;;3198:12;;;3190:20;;;;3217:25;;;3080:168::o;1507:114::-;1215:5;;;;1201:10;:19;1193:28;;;;;;1584:5;;;1565:25;;1584:5;;;;;1565:25;;;1613:1;1597:18;;;;;;1507:114::o;4017:105::-;4071:7;4098:10;;;:5;:10;;;;;:16;;4017:105::o;712:20::-;;;;;;:::o;5446:90::-;5516:5;:12;5446:90;;:::o;3709:37::-;;;;;;;;;;;;;;;;;;;:::o;5237:92::-;5280:9;5316:5;5309:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5237:92;:::o;2531:27::-;;;;;;:::o;2893:98::-;1215:5;;;;1201:10;:19;1193:28;;;;;;2962:12;:23;;;;;;;;;;;;;;;2893:98::o;3553:40::-;;;;;;;;;;;;;;;;;;;:::o;5709:328::-;5780:6;5803:10;;:24;;;;-1:-1:-1;5817:10:0;;;5803:24;5799:63;;;-1:-1:-1;5849:13:0;5842:20;;5799:63;5877:10;;;;;:24;;-1:-1:-1;5891:10:0;;5877:24;5873:63;;;-1:-1:-1;5923:13:0;5916:20;;5873:63;5951:14;;;5947:53;;-1:-1:-1;5987:13:0;5980:20;;5947:53;-1:-1:-1;6018:11:0;5709:328;;;;;:::o;3492:2548::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;
Swarm Source
bzzr://a4abafbe946fb93bc84221d4d3cd5d609499327db4019d43069616f110a0ead9
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 32 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.