false
false
The Sokol Testnet is currently lacking validators. Please consider using Goerli or Mumbai for testing purposes.

Contract Address Details
contract

0x3579669219DC20Aa79E74eEFD5fB2EcB0CE5fE0D

Contract Name
ArianeeWhitelist
Creator
0xd03ea8–89b117 at 0x4cb598–f6924f
Balance
0 SPOA
Tokens
Fetching tokens...
Transactions
3,823 Transactions
Transfers
0 Transfers
Gas Used
134,649,766
Last Balance Update
27736955
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
ArianeeWhitelist




Optimization enabled
true
Compiler version
v0.5.6+commit.b259423e




Verified at
2019-06-11T10:08:39.135353Z

Contract source code

Sol2uml
new
// File: @0xcert/ethereum-utils-contracts/src/contracts/math/safe-math.sol

pragma solidity 0.5.6;

/**
 * @dev Math operations with safety checks that throw on error. This contract is based on the
 * source code at:
 * https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol.
 */
library SafeMath
{

  /**
   * @dev Error constants.
   */
  string constant OVERFLOW = "008001";
  string constant SUBTRAHEND_GREATER_THEN_MINUEND = "008002";
  string constant DIVISION_BY_ZERO = "008003";

  /**
   * @dev Multiplies two numbers, reverts on overflow.
   * @param _factor1 Factor number.
   * @param _factor2 Factor number.
   * @return The product of the two factors.
   */
  function mul(
    uint256 _factor1,
    uint256 _factor2
  )
    internal
    pure
    returns (uint256 product)
  {
    // 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-solidity/pull/522
    if (_factor1 == 0)
    {
      return 0;
    }

    product = _factor1 * _factor2;
    require(product / _factor1 == _factor2, OVERFLOW);
  }

  /**
   * @dev Integer division of two numbers, truncating the quotient, reverts on division by zero.
   * @param _dividend Dividend number.
   * @param _divisor Divisor number.
   * @return The quotient.
   */
  function div(
    uint256 _dividend,
    uint256 _divisor
  )
    internal
    pure
    returns (uint256 quotient)
  {
    // Solidity automatically asserts when dividing by 0, using all gas.
    require(_divisor > 0, DIVISION_BY_ZERO);
    quotient = _dividend / _divisor;
    // assert(_dividend == _divisor * quotient + _dividend % _divisor); // There is no case in which this doesn't hold.
  }

  /**
   * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
   * @param _minuend Minuend number.
   * @param _subtrahend Subtrahend number.
   * @return Difference.
   */
  function sub(
    uint256 _minuend,
    uint256 _subtrahend
  )
    internal
    pure
    returns (uint256 difference)
  {
    require(_subtrahend <= _minuend, SUBTRAHEND_GREATER_THEN_MINUEND);
    difference = _minuend - _subtrahend;
  }

  /**
   * @dev Adds two numbers, reverts on overflow.
   * @param _addend1 Number.
   * @param _addend2 Number.
   * @return Sum.
   */
  function add(
    uint256 _addend1,
    uint256 _addend2
  )
    internal
    pure
    returns (uint256 sum)
  {
    sum = _addend1 + _addend2;
    require(sum >= _addend1, OVERFLOW);
  }

  /**
    * @dev Divides two numbers and returns the remainder (unsigned integer modulo), reverts when
    * dividing by zero.
    * @param _dividend Number.
    * @param _divisor Number.
    * @return Remainder.
    */
  function mod(
    uint256 _dividend,
    uint256 _divisor
  )
    internal
    pure
    returns (uint256 remainder)
  {
    require(_divisor != 0, DIVISION_BY_ZERO);
    remainder = _dividend % _divisor;
  }

}

// File: @0xcert/ethereum-utils-contracts/src/contracts/permission/abilitable.sol

pragma solidity 0.5.6;


/**
 * @title Contract for setting abilities.
 * @dev For optimization purposes the abilities are represented as a bitfield. Maximum number of
 * abilities is therefore 256. This is an example(for simplicity is made for max 8 abilities) of how
 * this works.
 * 00000001 Ability A - number representation 1
 * 00000010 Ability B - number representation 2
 * 00000100 Ability C - number representation 4
 * 00001000 Ability D - number representation 8
 * 00010000 Ability E - number representation 16
 * etc ...
 * To grant abilities B and C, we would need a bitfield of 00000110 which is represented by number
 * 6, in other words, the sum of abilities B and C. The same concept works for revoking abilities
 * and checking if someone has multiple abilities.
 */
contract Abilitable
{
  using SafeMath for uint;

  /**
   * @dev Error constants.
   */
  string constant NOT_AUTHORIZED = "017001";
  string constant CANNOT_REVOKE_OWN_SUPER_ABILITY = "017002";
  string constant INVALID_INPUT = "017003";

  /**
   * @dev Ability 1 (00000001) is a reserved ability called super ability. It is an
   * ability to grant or revoke abilities of other accounts. Other abilities are determined by the
   * implementing contract.
   */
  uint8 constant SUPER_ABILITY = 1;

  /**
   * @dev Maps address to ability ids.
   */
  mapping(address => uint256) public addressToAbility;

  /**
   * @dev Emits when an address is granted an ability.
   * @param _target Address to which we are granting abilities.
   * @param _abilities Number representing bitfield of abilities we are granting.
   */
  event GrantAbilities(
    address indexed _target,
    uint256 indexed _abilities
  );

  /**
   * @dev Emits when an address gets an ability revoked.
   * @param _target Address of which we are revoking an ability.
   * @param _abilities Number representing bitfield of abilities we are revoking.
   */
  event RevokeAbilities(
    address indexed _target,
    uint256 indexed _abilities
  );

  /**
   * @dev Guarantees that msg.sender has certain abilities.
   */
  modifier hasAbilities(
    uint256 _abilities
  )
  {
    require(_abilities > 0, INVALID_INPUT);
    require(
      addressToAbility[msg.sender] & _abilities == _abilities,
      NOT_AUTHORIZED
    );
    _;
  }

  /**
   * @dev Contract constructor.
   * Sets SUPER_ABILITY ability to the sender account.
   */
  constructor()
    public
  {
    addressToAbility[msg.sender] = SUPER_ABILITY;
    emit GrantAbilities(msg.sender, SUPER_ABILITY);
  }

  /**
   * @dev Grants specific abilities to specified address.
   * @param _target Address to grant abilities to.
   * @param _abilities Number representing bitfield of abilities we are granting.
   */
  function grantAbilities(
    address _target,
    uint256 _abilities
  )
    external
    hasAbilities(SUPER_ABILITY)
  {
    addressToAbility[_target] |= _abilities;
    emit GrantAbilities(_target, _abilities);
  }

  /**
   * @dev Unassigns specific abilities from specified address.
   * @param _target Address of which we revoke abilites.
   * @param _abilities Number representing bitfield of abilities we are revoking.
   * @param _allowSuperRevoke Additional check that prevents you from removing your own super
   * ability by mistake.
   */
  function revokeAbilities(
    address _target,
    uint256 _abilities,
    bool _allowSuperRevoke
  )
    external
    hasAbilities(SUPER_ABILITY)
  {
    if (!_allowSuperRevoke && msg.sender == _target)
    {
      require((_abilities & 1) == 0, CANNOT_REVOKE_OWN_SUPER_ABILITY);
    }
    addressToAbility[_target] &= ~_abilities;
    emit RevokeAbilities(_target, _abilities);
  }

  /**
   * @dev Check if an address has a specific ability. Throws if checking for 0.
   * @param _target Address for which we want to check if it has a specific abilities.
   * @param _abilities Number representing bitfield of abilities we are checking.
   */
  function isAble(
    address _target,
    uint256 _abilities
  )
    external
    view
    returns (bool)
  {
    require(_abilities > 0, INVALID_INPUT);
    return (addressToAbility[_target] & _abilities) == _abilities;
  }

}

// File: contracts/ArianeeWhitelist.sol

pragma solidity 0.5.6;


contract ArianeeWhitelist is
Abilitable{

  /**
   * @dev Mapping from  token id to whitelisted address
   */
  mapping(uint256=> mapping(address=>bool)) internal whitelistedAddress;

  /**
   * @dev Mapping from address to token to blacklisted address.
   */
  mapping(address=> mapping(uint256=> mapping(address=>bool))) internal optOutAddressPerOwner;

  /**
   * @dev This emits when a new address is whitelisted for a token
   */
  event WhitelistedAddressAdded(uint256 _tokenId, address _address);

  /**
   * @dev This emits when an address is blacklisted by a NFT owner on a given token.
   */
  event BlacklistedAddresAdded(address _sender, uint256 _tokenId, bool _activate);

  uint8 constant ABILITY_ADD_WHITELIST = 2;

  /**
   * @dev add an address to the whitelist for a nft.
   * @notice can only be called by contract authorized.
   * @param _tokenId id of the nft
   * @param _address address to whitelist.
   */
  function addWhitelistedAddress(uint256 _tokenId, address _address) external hasAbilities(ABILITY_ADD_WHITELIST) {
      whitelistedAddress[_tokenId][_address] = true;
      emit WhitelistedAddressAdded(_tokenId, _address);
  }

  /**
   * @dev blacklist an address by a receiver.
   * @param _sender address to blacklist.
   * @param _activate blacklist or unblacklist the sender
   */
  function addBlacklistedAddress(address _sender, uint256 _tokenId, bool _activate) external {
      optOutAddressPerOwner[msg.sender][_tokenId][_sender] = _activate;
      emit BlacklistedAddresAdded(_sender, _tokenId, _activate);
  }

  /**
   * @dev Return if a sender is authorized to send  message to this owner.
   * @param _tokenId NFT to check.
   * @param _sender address to check.
   * @param _tokenOwner owner of the token id.
   * @return true if address it authorized.
   */
  function isAuthorized(uint256 _tokenId, address _sender, address _tokenOwner) external view returns(bool) {
      return (whitelistedAddress[_tokenId][_sender] && !isBlacklisted(_tokenOwner, _sender, _tokenId));
  }

  /**
   * @dev Return if an address whitelisted for a given NFT.
   * @param _tokenId NFT to check.
   * @param _address address to check.
   * @return true if address it whitelisted.
   */
  function isWhitelisted(uint256 _tokenId, address _address) public view returns (bool _isWhitelisted) {
      _isWhitelisted = whitelistedAddress[_tokenId][_address];
  }

  /**
   * @dev Return if an address backlisted by a user for a given NFT.
   * @param _owner owner of the token id.
   * @param _sender address to check.
   * @param _tokenId NFT to check.
   * @return true if address it blacklisted.
   */
  function isBlacklisted(address _owner, address _sender, uint256 _tokenId) public view returns(bool _isBlacklisted) {
      _isBlacklisted = optOutAddressPerOwner[_owner][_tokenId][_sender];
  }

}
        

Contract ABI

[{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"grantAbilities","inputs":[{"type":"address","name":"_target"},{"type":"uint256","name":"_abilities"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":"_isBlacklisted"}],"name":"isBlacklisted","inputs":[{"type":"address","name":"_owner"},{"type":"address","name":"_sender"},{"type":"uint256","name":"_tokenId"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"addressToAbility","inputs":[{"type":"address","name":""}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"isAuthorized","inputs":[{"type":"uint256","name":"_tokenId"},{"type":"address","name":"_sender"},{"type":"address","name":"_tokenOwner"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":"_isWhitelisted"}],"name":"isWhitelisted","inputs":[{"type":"uint256","name":"_tokenId"},{"type":"address","name":"_address"}],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"addWhitelistedAddress","inputs":[{"type":"uint256","name":"_tokenId"},{"type":"address","name":"_address"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"revokeAbilities","inputs":[{"type":"address","name":"_target"},{"type":"uint256","name":"_abilities"},{"type":"bool","name":"_allowSuperRevoke"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"isAble","inputs":[{"type":"address","name":"_target"},{"type":"uint256","name":"_abilities"}],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"addBlacklistedAddress","inputs":[{"type":"address","name":"_sender"},{"type":"uint256","name":"_tokenId"},{"type":"bool","name":"_activate"}],"constant":false},{"type":"event","name":"WhitelistedAddressAdded","inputs":[{"type":"uint256","name":"_tokenId","indexed":false},{"type":"address","name":"_address","indexed":false}],"anonymous":false},{"type":"event","name":"BlacklistedAddresAdded","inputs":[{"type":"address","name":"_sender","indexed":false},{"type":"uint256","name":"_tokenId","indexed":false},{"type":"bool","name":"_activate","indexed":false}],"anonymous":false},{"type":"event","name":"GrantAbilities","inputs":[{"type":"address","name":"_target","indexed":true},{"type":"uint256","name":"_abilities","indexed":true}],"anonymous":false},{"type":"event","name":"RevokeAbilities","inputs":[{"type":"address","name":"_target","indexed":true},{"type":"uint256","name":"_abilities","indexed":true}],"anonymous":false}]
              

Contract Creation Code

0x6080604081815233600081815260208190529182206001908190559290917fc4adfc5f00262a1ab9b2241c7e98408a91e58dc5777d786164bba34a7652f62f91a36108348061004f6000396000f3fe608060405234801561001057600080fd5b50600436106100865760e060020a60003504630ab319e8811461008b5780630f9222ef146100b957806345a32c86146101035780635d73c4ec1461013b5780637d22c35c1461016f57806387159d9b1461019b578063aca910e7146101c7578063ba00a330146101fb578063e716561b14610227575b600080fd5b6100b7600480360360408110156100a157600080fd5b50600160a060020a03813516906020013561025b565b005b6100ef600480360360608110156100cf57600080fd5b50600160a060020a038135811691602081013590911690604001356103a7565b604080519115158252519081900360200190f35b6101296004803603602081101561011957600080fd5b5035600160a060020a03166103de565b60408051918252519081900360200190f35b6100ef6004803603606081101561015157600080fd5b50803590600160a060020a03602082013581169160400135166103f0565b6100ef6004803603604081101561018557600080fd5b5080359060200135600160a060020a0316610432565b6100b7600480360360408110156101b157600080fd5b5080359060200135600160a060020a031661045c565b6100b7600480360360608110156101dd57600080fd5b50600160a060020a038135169060208101359060400135151561056e565b6100ef6004803603604081101561021157600080fd5b50600160a060020a0381351690602001356106ef565b6100b76004803603606081101561023d57600080fd5b50600160a060020a0381351690602081013590604001351515610788565b604080518082019091526006815260d060020a653031373030330260208201526001906102d6565b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5033600090815260208181526040918290205482518084019093526006835260d060020a6530313730303102918301919091528216821461035b5760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b50600160a060020a038316600081815260208190526040808220805486179055518492917fc4adfc5f00262a1ab9b2241c7e98408a91e58dc5777d786164bba34a7652f62f91a3505050565b600160a060020a03928316600090815260026020908152604080832093835292815282822093909416815291909252205460ff1690565b60006020819052908152604090205481565b6000838152600160209081526040808320600160a060020a038616845290915281205460ff16801561042a57506104288284866103a7565b155b949350505050565b6000918252600160209081526040808420600160a060020a03909316845291905290205460ff1690565b604080518082018252600680825260d060020a653031373030330260209283015233600090815280835283902054835180850190945290835260d060020a65303137303031029183019190915260029190821682146104ff5760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b506000838152600160208181526040808420600160a060020a03871680865290835293819020805460ff191690931790925581518681529081019290925280517fa1fc15b295f9db85ce6f3e653f9a7e79e321f0828de5d7d09a5b0618bab645599281900390910190a1505050565b604080518082018252600680825260d060020a653031373030330260209283015233600090815280835283902054835180850190945290835260d060020a65303137303031029183019190915260019190821682146106115760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b5081158015610628575033600160a060020a038516145b156106a257604080518082019091526006815260d160020a6518189b98181902602082015260018416156106a05760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b505b600160a060020a03841660008181526020819052604080822080548719169055518592917fbb71944f65b9a48cc7d835179fb5e874f29b60aa0195785fb54968d8dddef08a91a350505050565b600080821160405180604001604052806006815260200160d060020a6530313730303302815250906107655760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b5050600160a060020a039190911660009081526020819052604090205481161490565b3360009081526002602090815260408083208584528252808320600160a060020a03871680855290835292819020805485151560ff199091168117909155815193845291830185905282810191909152517fd9ce29b70508c42ba4c716e51cd5645b51ef2aaa8e83b40902860c4012ae4caf9181900360600190a150505056fea165627a7a723058203bd7424b6cc2e162af28e718c15a55e4b87c1310c22e6913ca0da1d431d5a3f60029

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100865760e060020a60003504630ab319e8811461008b5780630f9222ef146100b957806345a32c86146101035780635d73c4ec1461013b5780637d22c35c1461016f57806387159d9b1461019b578063aca910e7146101c7578063ba00a330146101fb578063e716561b14610227575b600080fd5b6100b7600480360360408110156100a157600080fd5b50600160a060020a03813516906020013561025b565b005b6100ef600480360360608110156100cf57600080fd5b50600160a060020a038135811691602081013590911690604001356103a7565b604080519115158252519081900360200190f35b6101296004803603602081101561011957600080fd5b5035600160a060020a03166103de565b60408051918252519081900360200190f35b6100ef6004803603606081101561015157600080fd5b50803590600160a060020a03602082013581169160400135166103f0565b6100ef6004803603604081101561018557600080fd5b5080359060200135600160a060020a0316610432565b6100b7600480360360408110156101b157600080fd5b5080359060200135600160a060020a031661045c565b6100b7600480360360608110156101dd57600080fd5b50600160a060020a038135169060208101359060400135151561056e565b6100ef6004803603604081101561021157600080fd5b50600160a060020a0381351690602001356106ef565b6100b76004803603606081101561023d57600080fd5b50600160a060020a0381351690602081013590604001351515610788565b604080518082019091526006815260d060020a653031373030330260208201526001906102d6565b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5033600090815260208181526040918290205482518084019093526006835260d060020a6530313730303102918301919091528216821461035b5760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b50600160a060020a038316600081815260208190526040808220805486179055518492917fc4adfc5f00262a1ab9b2241c7e98408a91e58dc5777d786164bba34a7652f62f91a3505050565b600160a060020a03928316600090815260026020908152604080832093835292815282822093909416815291909252205460ff1690565b60006020819052908152604090205481565b6000838152600160209081526040808320600160a060020a038616845290915281205460ff16801561042a57506104288284866103a7565b155b949350505050565b6000918252600160209081526040808420600160a060020a03909316845291905290205460ff1690565b604080518082018252600680825260d060020a653031373030330260209283015233600090815280835283902054835180850190945290835260d060020a65303137303031029183019190915260029190821682146104ff5760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b506000838152600160208181526040808420600160a060020a03871680865290835293819020805460ff191690931790925581518681529081019290925280517fa1fc15b295f9db85ce6f3e653f9a7e79e321f0828de5d7d09a5b0618bab645599281900390910190a1505050565b604080518082018252600680825260d060020a653031373030330260209283015233600090815280835283902054835180850190945290835260d060020a65303137303031029183019190915260019190821682146106115760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b5081158015610628575033600160a060020a038516145b156106a257604080518082019091526006815260d160020a6518189b98181902602082015260018416156106a05760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b505b600160a060020a03841660008181526020819052604080822080548719169055518592917fbb71944f65b9a48cc7d835179fb5e874f29b60aa0195785fb54968d8dddef08a91a350505050565b600080821160405180604001604052806006815260200160d060020a6530313730303302815250906107655760405160e560020a62461bcd02815260206004820181815283516024840152835190928392604490910191908501908083836000831561029b578181015183820152602001610283565b5050600160a060020a039190911660009081526020819052604090205481161490565b3360009081526002602090815260408083208584528252808320600160a060020a03871680855290835292819020805485151560ff199091168117909155815193845291830185905282810191909152517fd9ce29b70508c42ba4c716e51cd5645b51ef2aaa8e83b40902860c4012ae4caf9181900360600190a150505056fea165627a7a723058203bd7424b6cc2e162af28e718c15a55e4b87c1310c22e6913ca0da1d431d5a3f60029