Address Contract Partially Verified
Address
0x84432dC3b052ffd9B6aC71c7E80551C8D6b794d3
Balance
0.001760 ETH
Nonce
1
Code Size
7099 bytes
Creator
0xCEcB4B16...b1C0 at tx 0x19d8e8fd...262ee1
Indexed Transactions
0
Contract Bytecode
7099 bytes
0x6080604052600436106102035763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630e167733811461020557806315937df81461022c57806325ffe86f14610241578063284d30ef1461026d57806329890d9d146102a05780632a4f8e79146102d25780632ee107bf146102da57806332a8c1fb146102ef578063388b254014610318578063410ba5181461032d57806341e21e93146103425780634783c35b146103575780634e71d92d14610388578063500076ae1461039d5780635f743a05146103c7578063605a359f146103dc57806369d03738146103f1578063715018a61461042457806377526f511461043957806389f3b0e71461044e5780638da5cb5b146104635780638ef5c626146104785780638f32d59b1461048d578063934aa023146104a257806398202c5d146104b757806399f64fe1146104cc578063a988fe37146104e1578063ab7a5788146104f6578063ae90b2131461050b578063b4a99a4e14610520578063b78f6de514610535578063becfbf7d1461054a578063bf3506c114610576578063c19cd379146105a9578063c9eb637e146105be578063cb9803f2146105d3578063df27e6e114610606578063e729a83714610636578063f2065ce51461064b578063f2fde38b14610677578063fdad9bcd146106aa578063fde6d672146106d6575b005b34801561021157600080fd5b5061021a6106eb565b60408051918252519081900360200190f35b34801561023857600080fd5b5061021a6106f1565b34801561024d57600080fd5b506102036004803603602081101561026457600080fd5b503515156106f7565b34801561027957600080fd5b506102036004803603602081101561029057600080fd5b5035600160a060020a0316610756565b3480156102ac57600080fd5b50610203600480360360408110156102c357600080fd5b508035151590602001356107d1565b610203610834565b3480156102e657600080fd5b5061021a610b06565b3480156102fb57600080fd5b50610304610b0c565b604080519115158252519081900360200190f35b34801561032457600080fd5b5061021a610b1b565b34801561033957600080fd5b5061021a610b21565b34801561034e57600080fd5b5061021a610b27565b34801561036357600080fd5b5061036c610b2d565b60408051600160a060020a039092168252519081900360200190f35b34801561039457600080fd5b50610203610b3c565b3480156103a957600080fd5b5061021a600480360360208110156103c057600080fd5b50356110bd565b3480156103d357600080fd5b5061036c6110f0565b3480156103e857600080fd5b506103046110ff565b3480156103fd57600080fd5b506102036004803603602081101561041457600080fd5b5035600160a060020a0316611108565b34801561043057600080fd5b50610203611183565b34801561044557600080fd5b5061021a611226565b34801561045a57600080fd5b5061021a61122c565b34801561046f57600080fd5b5061036c611232565b34801561048457600080fd5b5061021a611241565b34801561049957600080fd5b50610304611262565b3480156104ae57600080fd5b5061036c611286565b3480156104c357600080fd5b5061021a611295565b3480156104d857600080fd5b5061030461129b565b3480156104ed57600080fd5b506103046112a4565b34801561050257600080fd5b506102036112b2565b34801561051757600080fd5b5061036c6114cd565b34801561052c57600080fd5b5061036c6114dc565b34801561054157600080fd5b5061021a6114eb565b34801561055657600080fd5b506102036004803603602081101561056d57600080fd5b503515156114f1565b34801561058257600080fd5b506103046004803603602081101561059957600080fd5b5035600160a060020a0316611557565b3480156105b557600080fd5b5061021a6116a8565b3480156105ca57600080fd5b5061021a6116ae565b3480156105df57600080fd5b50610203600480360360208110156105f657600080fd5b5035600160a060020a03166116b4565b34801561061257600080fd5b506102036004803603604081101561062957600080fd5b508035906020013561172f565b34801561064257600080fd5b506103046117ac565b34801561065757600080fd5b506102036004803603602081101561066e57600080fd5b503515156117ba565b34801561068357600080fd5b506102036004803603602081101561069a57600080fd5b5035600160a060020a0316611820565b3480156106b657600080fd5b50610203600480360360208110156106cd57600080fd5b50351515611878565b3480156106e257600080fd5b5061036c6118e0565b600c5481565b60125481565b6106ff611262565b1515610743576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b6008805460ff1916911515919091179055565b61075e611262565b15156107a2576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6107d9611262565b151561081d576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b6013805460ff191692151592909217909155601255565b6000806007543410151515610893576040805160e560020a62461bcd02815260206004820152601460248201527f4a6f696e696e6720666565206e6f74206d657421000000000000000000000000604482015290519081900360640190fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a03909216916370a0823191602480820192602092909190829003018186803b1580156108f757600080fd5b505afa15801561090b573d6000803e3d6000fd5b505050506040513d602081101561092157600080fd5b505191506000821161097d576040805160e560020a62461bcd02815260206004820181905260248201527f596f7520646f206e6f7420686f6c6420616e792077726170706564204e465473604482015290519081900360640190fd5b61098633611557565b905080156109de576040805160e560020a62461bcd02815260206004820152601860248201527f596f752061726520616c726561647920656c696761626c650000000000000000604482015290519081900360640190fd5b600254601454604080517fe83dbf7100000000000000000000000000000000000000000000000000000000815233600482015260248101929092526001604483015251600160a060020a039092169163e83dbf719160648082019260009290919082900301818387803b158015610a5457600080fd5b505af1158015610a68573d6000803e3d6000fd5b5050600254604080517fc572a034000000000000000000000000000000000000000000000000000000008152600160048201523360248201529051600160a060020a03909216935063c572a034925060448082019260009290919082900301818387803b158015610ad857600080fd5b505af1158015610aec573d6000803e3d6000fd5b505033600090815260156020526040902042905550505050565b60115481565b60085462010000900460ff1681565b60095481565b600e5481565b600b5481565b600454600160a060020a031681565b60035460009081908190600160a060020a03163314610cd25760085460ff161515600114610bb4576040805160e560020a62461bcd02815260206004820152601660248201527f526f79616c74696573206e6f7420656e61626c65642100000000000000000000604482015290519081900360640190fd5b503360008181526015602052604090205490610bcf90611557565b9150600182151514610c50576040805160e560020a62461bcd028152602060048201526024808201527f596f7520617265206e6f7420656c696761626c6520746f206d616b652061206360448201527f6c61696d00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6201518081014211610cd2576040805160e560020a62461bcd02815260206004820152602f60248201527f596f7520617265206f6e6c792061626c6520746f20636c61696d206f6e63652060448201527f657665727920323420686f757273210000000000000000000000000000000000606482015290519081900360840190fd5b600b546201518001421115610ee55742600b5530319250610cfa83606463ffffffff6118ef16565b9250610d0d83603263ffffffff61193816565b600955610d2183603163ffffffff61193816565b600c819055600454604051600160a060020a039091169180156108fc02916000818181858888f19350505050158015610d5e573d6000803e3d6000fd5b5060135460ff161515610ecc57600f5460011415610e0b57600254604080517f52200a13000000000000000000000000000000000000000000000000000000008152600160048201529051600160a060020a03909216916352200a1391602480820192602092909190829003018186803b158015610ddb57600080fd5b505afa158015610def573d6000803e3d6000fd5b505050506040513d6020811015610e0557600080fd5b50516012555b600f5460021415610eab5760028054604080517f52200a13000000000000000000000000000000000000000000000000000000008152600481019390935251600160a060020a03909116916352200a13916024808301926020929190829003018186803b158015610e7b57600080fd5b505afa158015610e8f573d6000803e3d6000fd5b505050506040513d6020811015610ea557600080fd5b50516012555b60085462010000900460ff16151560011415610ecc57601280546000190190555b601254600954610ee19163ffffffff6118ef16565b600a555b60135460ff6101009091041615156001148015610f0c5750600354600160a060020a031633145b1561104f576000805b60125481101561104c57600254604080517f7fdd822e000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a0390921691637fdd822e91602480820192602092909190829003018186803b158015610f8457600080fd5b505afa158015610f98573d6000803e3d6000fd5b505050506040513d6020811015610fae57600080fd5b50519150610fbb82611557565b93506001841515141561104457600160a060020a038216600090815260156020526040902054925062015180830142111561104457600a54604051600160a060020a0384169180156108fc02916000818181858888f19350505050158015611027573d6000803e3d6000fd5b50600160a060020a03821660009081526015602052604090204290555b600101610f15565b50505b600354600160a060020a031633146110a357600a54604051339180156108fc02916000818181858888f1935050505015801561108f573d6000803e3d6000fd5b503360009081526015602052604090204290555b5050600a54600e8054909101905550601180546001019055565b60008082600114156110ce5750600e545b82600214156110dc57506011545b82600314156110ea57506010545b92915050565b600254600160a060020a031681565b60085460ff1681565b611110611262565b1515611154576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b61118b611262565b15156111cf576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60105481565b600a5481565b600054600160a060020a031690565b600a54600b5460009190620151800142111561125d57506298967f5b905090565b60008054600160a060020a03166112776119d4565b600160a060020a031614905090565b600654600160a060020a031681565b600d5481565b60135460ff1681565b601354610100900460ff1681565b600354600160a060020a0316331461132257600b5462015180014211611322576040805160e560020a62461bcd02815260206004820152601560248201527f526562616c616e6365206973206e6f7420647565210000000000000000000000604482015290519081900360640190fd5b600854610100900460ff16151561139557600354600160a060020a03163314611395576040805160e560020a62461bcd02815260206004820152600e60248201527f4e6f7420417574686f72697a6564000000000000000000000000000000000000604482015290519081900360640190fd5b42600b5530316113ac81606463ffffffff6118ef16565b90506113bf81603263ffffffff61193816565b6009556113d381603163ffffffff61193816565b600c819055600454604051600160a060020a039091169180156108fc02916000818181858888f19350505050158015611410573d6000803e3d6000fd5b5060135460ff1615156114b25760028054604080517f52200a13000000000000000000000000000000000000000000000000000000008152600481019390935251600160a060020a03909116916352200a13916024808301926020929190829003018186803b15801561148257600080fd5b505afa158015611496573d6000803e3d6000fd5b505050506040513d60208110156114ac57600080fd5b50516012555b6012546009546114c79163ffffffff6118ef16565b600a5550565b600554600160a060020a031681565b600354600160a060020a031681565b60145481565b6114f9611262565b151561153d576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b600880549115156101000261ff0019909216919091179055565b600254604080517f387d42c5000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015291516000938493849391169163387d42c591602480820192602092909190829003018186803b1580156115c357600080fd5b505afa1580156115d7573d6000803e3d6000fd5b505050506040513d60208110156115ed57600080fd5b5051600154604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a03888116600483015291519395509116916370a0823191602480820192602092909190829003018186803b15801561165757600080fd5b505afa15801561166b573d6000803e3d6000fd5b505050506040513d602081101561168157600080fd5b5051905060018215151480156116975750600081115b156116a157600191505b5092915050565b60075481565b600f5481565b6116bc611262565b1515611700576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b611737611262565b151561177b576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b816001141561178a5760078190555b81600214156117995760148190555b81600314156117a857600f8190555b5050565b600854610100900460ff1681565b6117c2611262565b1515611806576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b601380549115156101000261ff0019909216919091179055565b611828611262565b151561186c576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b611875816119d8565b50565b611880611262565b15156118c4576040805160e560020a62461bcd0281526020600482018190526024820152600080516020611b70833981519152604482015290519081900360640190fd5b60088054911515620100000262ff000019909216919091179055565b600154600160a060020a031681565b600061193183836040805190810160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ac6565b9392505050565b6000821515611949575060006110ea565b82820282848281151561195857fe5b0414611931576040805160e560020a62461bcd02815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f7700000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b3390565b600160a060020a0381161515611a5e576040805160e560020a62461bcd02815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600081818411611b575760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b1c578181015183820152602001611b04565b50505050905090810190601f168015611b495780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385811515611b6557fe5b049594505050505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a165627a7a723058209fb7188e1c87ea550d7d5dbabeb71fdbd380f6bc273e4fb85dd4642635dd96470029
Verified Source Code Partial Match
Compiler: v0.5.0+commit.1d4f565a
EVM: byzantium
Optimization: Yes (200 runs)
wTCRoyalties.sol 580 lines
pragma solidity >=0.5.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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: node_modules\@openzeppelin\contracts\GSN\Context.sol
pragma solidity >=0.5.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.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin\contracts\ownership\Ownable.sol
pragma solidity ^0.5.0;
/**
* @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.
*
* 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(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _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 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 onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
__ __ _ _____ _
\ \ / / | | / ____| (_)
\ \ /\ / / __ __ _ _ __ _ __ ___ __| | | | ___ _ __ ___ _ __ __ _ _ __ _ ___ _ __
\ \/ \/ / '__/ _` | '_ \| '_ \ / _ \/ _` | | | / _ \| '_ ` _ \| '_ \ / _` | '_ \| |/ _ \| '_ \
\ /\ /| | | (_| | |_) | |_) | __/ (_| | | |___| (_) | | | | | | |_) | (_| | | | | | (_) | | | |
\/ \/ |_| \__,_| .__/| .__/ \___|\__,_| \_____\___/|_| |_| |_| .__/ \__,_|_| |_|_|\___/|_| |_|
| | | | | |
_____ |_| _ |_| _____ _ |_| _
| __ \ | | | / ____| | | | |
| |__) |___ _ _ __ _| | |_ _ _ | | ___ _ __ | |_ _ __ __ _ ___| |_
| _ // _ \| | | |/ _` | | __| | | | | | / _ \| '_ \| __| '__/ _` |/ __| __|
| | \ \ (_) | |_| | (_| | | |_| |_| | | |___| (_) | | | | |_| | | (_| | (__| |_
|_| \_\___/ \__, |\__,_|_|\__|\__, | \_____\___/|_| |_|\__|_| \__,_|\___|\__|
__/ | __/ |
|___/ |___/
/**
- This is designed to handle the royalty distributions to holders
- Royalties are split 50/50 with treasury and holders by default. Fees are adjustable
*/
pragma solidity ^0.5.0;
interface wrappedcompanion{
function balanceOf(address owner) external view returns (uint256);
}
interface wrapperdb {
function isHolder(address _address) external view returns(bool);
function getWrappedStatus(address _migrator) external view returns(bool);
function getNumHolders(uint _feed) external view returns(uint);
function getHolderAddress(uint _index) external view returns(address payable);
function setUserStatus(address _wrapper,uint _status,bool _haswrapped) external;
function manageHolderAddresses(bool status,address _holder) external;
}
contract wTCRoyalties is Context, Ownable {
address public wrappednft = 0x16e2220Bba4a2c5C71f628f4DB2D5D1e0D6ad6e0;
address public dbcontract = 0x131Bc921fDf520E62eca46c1011Fc885d6B29B9f;
address public Owner;
address payable public multisig = 0xCEcB4B16bF486a9B786A2a981a43de8647dCb1C0;
address payable public payee;
address payable public charity = 0x8B99F3660622e21f2910ECCA7fBe51d654a1517D;
uint public joiningfee = 10000000000000000; //0.01ETH A joining fee
bool public royaltydistribution; ///Enable/Disable Rewards
bool public anonrebalance; //USed to block anons from running a rebalance
bool public adjustforcontract;
uint public amounttoholders;
uint public fixedpayoutamount;
uint public lastrebalancetime; //This is the blocktime of the last split
uint public amounttotreasury;
uint public amounttocharity;
uint public totalpayouts;
uint public setfeed =2; //Default to array length
uint public totaltreasureypayouts;
uint public numberofclaims;
uint public numholders;
bool public holdersoverride; //Default to false
bool public masspayoutenabled = true; // A reflection for the users if needs be!
uint public defaultfee = 2; //the fee set for a user when the buy joining
//NB Addresses/////////
/////Mappings///////
mapping(address => uint) internal payouttime;
using SafeMath for uint;
constructor () public {
Owner = msg.sender; //Owner of Contract
lastrebalancetime = block.timestamp; //Set the initial to deploy time
}
///Sets the fees
function setFeesAndNB(int option,uint _value) external onlyOwner
{
if (option==1)
{
joiningfee = _value;
}
if(option==2)
{
defaultfee = _value;
}
if(option==3)
{
setfeed = _value;
}
}
function forceNumHolders(bool _onoroff,uint _numholders) external onlyOwner{
holdersoverride = _onoroff;
numholders = _numholders;
}
///Sets the contract address of the NFT itself//////
function setNFTAddress(address _nftaddress) external onlyOwner {
wrappednft = _nftaddress;
}
///Sets the Multi-Sig address//////
function setMultiSig(address payable _multiaddress) external onlyOwner {
multisig = _multiaddress;
}
///Sets the contract address of the DB //////
function setDBAddress(address _dbaddress) external onlyOwner {
dbcontract = _dbaddress;
}
///Function to enable/disable the Royalty Payouts
function onoffRoyalties(bool _enabled) external onlyOwner{
royaltydistribution = _enabled;
}
//Function to enable mass payout of royalties
function enableMassPayout(bool _onoroff) external onlyOwner{
masspayoutenabled = _onoroff;
}
//Function to enable anon rebalance
function enableAnonRebalance(bool _onoroff) external onlyOwner{
anonrebalance = _onoroff;
}
//Function to enable anon rebalance
function enableAdjust(bool _onoroff) external onlyOwner{
adjustforcontract = _onoroff;
}
///Function for user to check the amount of ETH roughly to be paid out
function rewardOf() external view returns(uint)
{
uint temp;
temp = fixedpayoutamount;
if (block.timestamp > lastrebalancetime + 24 hours )
{
temp = 9999999; ///A rebalance is due!
}
return temp;
}
////Function to handle the payout of royalties
function claim() external {
//Get the amounts of ETH required for reflection
uint ETHsplit;
bool iseligable;
uint lastpaid;
if(msg.sender!=Owner)
{
require(royaltydistribution==true,"Royalties not enabled!");
lastpaid = payouttime[msg.sender];
iseligable = canClaim(msg.sender);
require(iseligable==true,"You are not eligable to make a claim");
require(block.timestamp > lastpaid + 24 hours,"You are only able to claim once every 24 hours!");
}
///Determine if a rebalance is needed//
if (block.timestamp > lastrebalancetime + 24 hours )
{
lastrebalancetime = block.timestamp;
ETHsplit = address(this).balance;
ETHsplit = ETHsplit.div(100); //divides it into 1% parts
amounttoholders = ETHsplit.mul(50);
amounttotreasury = ETHsplit.mul(49); //Leave 1% in wallet as a buffer
////send money to treasury////
multisig.transfer(amounttotreasury);
//Get the number of holders in the array to determine the payout///
if (holdersoverride==false) //This is a failsafe to ensure that if needs be the num holders is able to be a fixed amount
{
if(setfeed==1)
{
numholders = wrapperdb(dbcontract).getNumHolders(1); //returns number of holders based on wraps
}
if(setfeed==2)
{
numholders = wrapperdb(dbcontract).getNumHolders(2); //returns length of the array (Should be value -1 (-1 for the NFT contract itself)
}
///This is to accomodate for the wTc contract being considered as a holder. Due to the nature of the wrapper, the numholders is +1.
///Having an extra holder adds a buffer of funds in the contract
if(adjustforcontract==true)
{
numholders = numholders - 1;
}
}
fixedpayoutamount = amounttoholders.div(numholders);
}
///mass payout for holders if required
if (masspayoutenabled==true && msg.sender==Owner) //Only the owner is able to do this!
{
address payable tempaddress;
for (uint256 s = 0; s < numholders; s += 1)
{
tempaddress = wrapperdb(dbcontract).getHolderAddress(s);
//Are they eligable?//
iseligable = canClaim(tempaddress);
if (iseligable==true)
{
//first verify 24 hour period
lastpaid = payouttime[tempaddress];
if(block.timestamp > lastpaid + 24 hours)
{
tempaddress.transfer(fixedpayoutamount);
///Mark the users time for claim
payouttime[tempaddress] = block.timestamp;
}
}
}
}
if(msg.sender!=Owner)
{
msg.sender.transfer(fixedpayoutamount);
///Mark the users time for claim
payouttime[msg.sender] = block.timestamp;
}
totalpayouts += fixedpayoutamount;
numberofclaims +=1;
}
///Rebalance function which can be run manually,is able to be run
function forceRebalance() external {
if(msg.sender!=Owner)
{
require (block.timestamp > lastrebalancetime + 24 hours,"Rebalance is not due!");
}
if(anonrebalance==false)
{
require(msg.sender==Owner,"Not Authorized");
}
uint ETHsplit;
lastrebalancetime = block.timestamp;
ETHsplit = address(this).balance;
ETHsplit = ETHsplit.div(100); //divides it into 1% parts
amounttoholders = ETHsplit.mul(50);
amounttotreasury = ETHsplit.mul(49);
////send money to treasury////
multisig.transfer(amounttotreasury);
//Get the number of holders in the array to determine the payout///
if (holdersoverride==false) //This is a failsafe to ensure that if needs be the num holders is able to be a fixed amount
{
numholders = wrapperdb(dbcontract).getNumHolders(2); //returns length of the array (Should be value -1 (-1 for the NFT contract itself)
}
fixedpayoutamount = amounttoholders.div(numholders);//
}
//returns stats from reflecting
function Stats(uint option) view external returns(uint)
{
uint temp;
if (option==1)
{
temp = totalpayouts;
}
if (option==2)
{
temp = numberofclaims;
}
if (option==3)
{
temp = totaltreasureypayouts;
}
return temp;
}
///Verify that a user is eligable to claim
function canClaim(address _wallet) public view returns(bool)
{
bool temp; //defaults to false
uint numberofNFT;
//////First verify that the user has wrapped...
temp = wrapperdb(dbcontract).getWrappedStatus(_wallet);
/////Are they still holding?
numberofNFT = wrappedcompanion(wrappednft).balanceOf(_wallet);
if (temp==true && numberofNFT > 0)
{
temp = true;
}
return temp;
}
///Allows buyers on OS to join fees...but only afer 24 hours!
function joinRoyalty() payable external{
uint numberofnft;
bool temp;
require(msg.value >= joiningfee,"Joining fee not met!");
numberofnft = wrappedcompanion(wrappednft).balanceOf(msg.sender);
require(numberofnft>0,"You do not hold any wrapped NFTs");
temp = canClaim(msg.sender);
require(temp==false,"You are already eligable");
wrapperdb(dbcontract).setUserStatus(msg.sender,defaultfee,true);
//add user to array!
wrapperdb(dbcontract).manageHolderAddresses(true,msg.sender);
payouttime[msg.sender] = block.timestamp;
}
////To recieve ETH
function () external payable {
}
}///////////////////Contract END//////////////////////
Read Contract
Owner 0xb4a99a4e → address
Stats 0x500076ae → uint256
adjustforcontract 0x32a8c1fb → bool
amounttocharity 0x98202c5d → uint256
amounttoholders 0x388b2540 → uint256
amounttotreasury 0x0e167733 → uint256
anonrebalance 0xe729a837 → bool
canClaim 0xbf3506c1 → bool
charity 0x934aa023 → address
dbcontract 0x5f743a05 → address
defaultfee 0xb78f6de5 → uint256
fixedpayoutamount 0x89f3b0e7 → uint256
holdersoverride 0x99f64fe1 → bool
isOwner 0x8f32d59b → bool
joiningfee 0xc19cd379 → uint256
lastrebalancetime 0x41e21e93 → uint256
masspayoutenabled 0xa988fe37 → bool
multisig 0x4783c35b → address
numberofclaims 0x2ee107bf → uint256
numholders 0x15937df8 → uint256
owner 0x8da5cb5b → address
payee 0xae90b213 → address
rewardOf 0x8ef5c626 → uint256
royaltydistribution 0x605a359f → bool
setfeed 0xc9eb637e → uint256
totalpayouts 0x410ba518 → uint256
totaltreasureypayouts 0x77526f51 → uint256
wrappednft 0xfde6d672 → address
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
claim 0x4e71d92d
No parameters
enableAdjust 0xfdad9bcd
bool _onoroff
enableAnonRebalance 0xbecfbf7d
bool _onoroff
enableMassPayout 0xf2065ce5
bool _onoroff
forceNumHolders 0x29890d9d
bool _onoroff
uint256 _numholders
forceRebalance 0xab7a5788
No parameters
joinRoyalty 0x2a4f8e79
No parameters
onoffRoyalties 0x25ffe86f
bool _enabled
renounceOwnership 0x715018a6
No parameters
setDBAddress 0xcb9803f2
address _dbaddress
setFeesAndNB 0xdf27e6e1
int256 option
uint256 _value
setMultiSig 0x284d30ef
address _multiaddress
setNFTAddress 0x69d03738
address _nftaddress
transferOwnership 0xf2fde38b
address newOwner
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address