[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 1 Internal Transaction

ParentTxHash Block Age From To Value
0x700b5f27c0b7dd14cc8aa833a540690f9a3db20ea3e6408123662379482876f950000329 days 47 mins ago0x6981564c255e066384cf7de499bd365b09bcf26b0x89af1d63c7e9be81ba3d052a891690f2bb149fba0 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact Match)
Contract Name: ApiKeyRegistry
Compiler Version: v0.5.3+commit.10d17f24
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity 0.5.3;

// File: /private/var/folders/2q/x2n3s2rx0d16552ynj1lx90r0000gn/T/tmp.wp7ES2VG/gluon-plasma/packages/on-chain/contracts/Stoppable.sol

/* using a master switch, allowing to permanently turn-off functionality */
contract Stoppable {

  /************************************ abstract **********************************/
  modifier onlyOwner { _; }
  /********************************************************************************/

  bool public isOn = true;

  modifier whenOn() { require(isOn, "must be on"); _; }
  modifier whenOff() { require(!isOn, "must be off"); _; }

  function switchOff() external onlyOwner {
    if (isOn) {
      isOn = false;
      emit Off();
    }
  }
  event Off();
}

// File: /private/var/folders/2q/x2n3s2rx0d16552ynj1lx90r0000gn/T/tmp.wp7ES2VG/gluon-plasma/packages/on-chain/contracts/Switchable.sol

/* using a master switch, allowing to switch functionality on/off */
contract Switchable is Stoppable {

  function switchOn() external onlyOwner {
    if (!isOn) {
      isOn = true;
      emit On();
    }
  }
  event On();
}

// File: /private/var/folders/2q/x2n3s2rx0d16552ynj1lx90r0000gn/T/tmp.wp7ES2VG/gluon-plasma/packages/on-chain/contracts/Validating.sol

contract Validating {

  modifier notZero(uint number) { require(number != 0, "invalid 0 value"); _; }
  modifier notEmpty(string memory text) { require(bytes(text).length != 0, "invalid empty string"); _; }
  modifier validAddress(address value) { require(value != address(0x0), "invalid address");  _; }

}

// File: /private/var/folders/2q/x2n3s2rx0d16552ynj1lx90r0000gn/T/tmp.wp7ES2VG/gluon-plasma/packages/on-chain/contracts/HasOwners.sol

contract HasOwners is Validating {

  mapping(address => bool) public isOwner;
  address[] private owners;

  constructor(address[] memory _owners) public {
    for (uint i = 0; i < _owners.length; i++) _addOwner_(_owners[i]);
    owners = _owners;
  }

  modifier onlyOwner { require(isOwner[msg.sender], "invalid sender; must be owner"); _; }

  function getOwners() public view returns (address[] memory) { return owners; }

  function addOwner(address owner) external onlyOwner {  _addOwner_(owner); }

  function _addOwner_(address owner) private validAddress(owner) {
    if (!isOwner[owner]) {
      isOwner[owner] = true;
      owners.push(owner);
      emit OwnerAdded(owner);
    }
  }
  event OwnerAdded(address indexed owner);

  function removeOwner(address owner) external onlyOwner {
    if (isOwner[owner]) {
      require(owners.length > 1, "removing the last owner is not allowed");
      isOwner[owner] = false;
      for (uint i = 0; i < owners.length - 1; i++) {
        if (owners[i] == owner) {
          owners[i] = owners[owners.length - 1]; // replace map last entry
          delete owners[owners.length - 1];
          break;
        }
      }
      owners.length -= 1;
      emit OwnerRemoved(owner);
    }
  }
  event OwnerRemoved(address indexed owner);
}

// File: /private/var/folders/2q/x2n3s2rx0d16552ynj1lx90r0000gn/T/tmp.wp7ES2VG/gluon-plasma/packages/on-chain/contracts/registry/Registry.sol

interface Registry {

  function contains(address apiKey) external view returns (bool);

  function register(address apiKey) external;
  function registerWithUserAgreement(address apiKey, bytes32 userAgreement) external;

  function translate(address apiKey) external view returns (address);
}

// File: contracts/registry/ApiKeyRegistry.sol

contract ApiKeyRegistry is Switchable, HasOwners, Registry {
  string public version;

  /* mapping of: address of api-key used in trading => address of account map funds used in settling */
  mapping (address => address) public accounts;
  mapping (address => bytes32) public userAgreements;

  constructor(address[] memory _owners, string memory _version) HasOwners(_owners) public {
    version = _version;
  }

  modifier isAbsent(address apiKey) { require(!contains(apiKey), "api key already in use"); _; }

  function contains(address apiKey) public view returns (bool) { return accounts[apiKey] != address(0x0); }

  function register(address apiKey) external { registerWithUserAgreement(apiKey, 0); }

  function registerWithUserAgreement(address apiKey, bytes32 userAgreement) public validAddress(apiKey) isAbsent(apiKey) whenOn {
    accounts[apiKey] = msg.sender;
    if (userAgreement != 0 && userAgreements[msg.sender] == 0) {
      userAgreements[msg.sender] = userAgreement;
    }
    emit Registered(apiKey, msg.sender, userAgreements[msg.sender]);
  }
  event Registered(address apiKey, address indexed account, bytes32 userAgreement);

  function translate(address apiKey) external view returns (address) { return accounts[apiKey]; }
}

    Contract ABI  
[{"constant":false,"inputs":[],"name":"switchOff","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"owner","type":"address"}],"name":"removeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isOn","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"apiKey","type":"address"}],"name":"register","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"apiKey","type":"address"},{"name":"userAgreement","type":"bytes32"}],"name":"registerWithUserAgreement","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"apiKey","type":"address"}],"name":"contains","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"accounts","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"owner","type":"address"}],"name":"addOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"userAgreements","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getOwners","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"apiKey","type":"address"}],"name":"translate","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"switchOn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_owners","type":"address[]"},{"name":"_version","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"apiKey","type":"address"},{"indexed":true,"name":"account","type":"address"},{"indexed":false,"name":"userAgreement","type":"bytes32"}],"name":"Registered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"OwnerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"OwnerRemoved","type":"event"},{"anonymous":false,"inputs":[],"name":"On","type":"event"},{"anonymous":false,"inputs":[],"name":"Off","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60806040526000805460ff191660011790553480156200001e57600080fd5b506040516200105038038062001050833981018060405260408110156200004457600080fd5b8101908080516401000000008111156200005d57600080fd5b820160208101848111156200007157600080fd5b81518560208202830111640100000000821117156200008f57600080fd5b50509291906020018051640100000000811115620000ac57600080fd5b82016020810184811115620000c057600080fd5b8151640100000000811182820187101715620000db57600080fd5b5090935084925060009150505b81518110156200012d576200012482828151811015156200010557fe5b9060200190602002015162000163640100000000026401000000009004565b600101620000e8565b508051620001439060029060208401906200028d565b505080516200015a906003906020840190620002f7565b505050620003bf565b80600160a060020a0381161515620001dc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420616464726573730000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03821660009081526001602052604090205460ff1615156200028957600160a060020a0382166000818152600160208190526040808320805460ff19168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9091018054600160a060020a03191684179055517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a25b5050565b828054828255906000526020600020908101928215620002e5579160200282015b82811115620002e55782518254600160a060020a031916600160a060020a03909116178255602090920191600190910190620002ae565b50620002f392915062000378565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200033a57805160ff19168380011785556200036a565b828001600101855582156200036a579182015b828111156200036a5782518255916020019190600101906200034d565b50620002f3929150620003a2565b6200039f91905b80821115620002f3578054600160a060020a03191681556001016200037f565b90565b6200039f91905b80821115620002f35760008155600101620003a9565b610c8180620003cf6000396000f3fe608060405234801561001057600080fd5b5060043610610107576000357c0100000000000000000000000000000000000000000000000000000000900480635dbe47e8116100a9578063828af1c011610083578063828af1c0146102db578063a0e67e2b14610313578063b05788781461036b578063f9f8f8951461039157610107565b80635dbe47e81461024d5780635e5c06e2146102735780637065cb48146102b557610107565b80632f54bf6e116100e55780632f54bf6e146101585780634420e4861461017e57806354fd4d50146101a45780635d4aaf1c1461022157610107565b8063038d71ee1461010c578063173825d914610116578063175bbecf1461013c575b600080fd5b610114610399565b005b6101146004803603602081101561012c57600080fd5b5035600160a060020a031661042f565b61014461064e565b604080519115158252519081900360200190f35b6101446004803603602081101561016e57600080fd5b5035600160a060020a0316610657565b6101146004803603602081101561019457600080fd5b5035600160a060020a031661066c565b6101ac610677565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e65781810151838201526020016101ce565b50505050905090810190601f1680156102135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101146004803603604081101561023757600080fd5b50600160a060020a038135169060200135610705565b6101446004803603602081101561026357600080fd5b5035600160a060020a03166108e3565b6102996004803603602081101561028957600080fd5b5035600160a060020a0316610903565b60408051600160a060020a039092168252519081900360200190f35b610114600480360360208110156102cb57600080fd5b5035600160a060020a031661091e565b610301600480360360208110156102f157600080fd5b5035600160a060020a031661097e565b60408051918252519081900360200190f35b61031b610990565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561035757818101518382015260200161033f565b505050509050019250505060405180910390f35b6102996004803603602081101561038157600080fd5b5035600160a060020a03166109f3565b610114610a11565b3360009081526001602052604090205460ff1615156103f0576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020610c10833981519152604482015290519081900360640190fd5b60005460ff161561042d576000805460ff191681556040517f369554cf721939830e3356301e1150520b7a57198eaabd24211952c158f3ba4e9190a15b565b3360009081526001602052604090205460ff161515610486576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020610c10833981519152604482015290519081900360640190fd5b600160a060020a03811660009081526001602052604090205460ff161561064b576002546001106104eb5760405160e560020a62461bcd028152600401808060200182810382526026815260200180610c306026913960400191505060405180910390fd5b600160a060020a0381166000908152600160205260408120805460ff191690555b600254600019018110156106015781600160a060020a031660028281548110151561053357fe5b600091825260209091200154600160a060020a031614156105f95760028054600019810190811061056057fe5b60009182526020909120015460028054600160a060020a03909216918390811061058657fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556002805460001981019081106105ce57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055610601565b60010161050c565b506002805460001901906106159082610bc8565b50604051600160a060020a038216907f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90600090a25b50565b60005460ff1681565b60016020526000908152604090205460ff1681565b61064b816000610705565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106fd5780601f106106d2576101008083540402835291602001916106fd565b820191906000526020600020905b8154815290600101906020018083116106e057829003601f168201915b505050505081565b81600160a060020a0381161515610766576040805160e560020a62461bcd02815260206004820152600f60248201527f696e76616c696420616464726573730000000000000000000000000000000000604482015290519081900360640190fd5b82610770816108e3565b156107c5576040805160e560020a62461bcd02815260206004820152601660248201527f617069206b657920616c726561647920696e2075736500000000000000000000604482015290519081900360640190fd5b60005460ff161515610821576040805160e560020a62461bcd02815260206004820152600a60248201527f6d757374206265206f6e00000000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0384166000908152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff1916331790558215801590610872575033600090815260056020526040902054155b1561088a573360009081526005602052604090208390555b33600081815260056020908152604091829020548251600160a060020a03891681529182015281517fcd784feabb8c0a2cea91505b9464c34e654e1646c6711b542aefdfbc3de7ccfb929181900390910190a250505050565b600160a060020a0390811660009081526004602052604090205416151590565b600460205260009081526040902054600160a060020a031681565b3360009081526001602052604090205460ff161515610975576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020610c10833981519152604482015290519081900360640190fd5b61064b81610aaa565b60056020526000908152604090205481565b606060028054806020026020016040519081016040528092919081815260200182805480156109e857602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116109ca575b505050505090505b90565b600160a060020a039081166000908152600460205260409020541690565b3360009081526001602052604090205460ff161515610a68576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020610c10833981519152604482015290519081900360640190fd5b60005460ff16151561042d576000805460ff191660011781556040517f85bcb519e391e40312ef8a2464a39ef113407c1ab2c87104eef7252fb7ec0f1f9190a1565b80600160a060020a0381161515610b0b576040805160e560020a62461bcd02815260206004820152600f60248201527f696e76616c696420616464726573730000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03821660009081526001602052604090205460ff161515610bc457600160a060020a0382166000818152600160208190526040808320805460ff19168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace909101805473ffffffffffffffffffffffffffffffffffffffff191684179055517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a25b5050565b815481835581811115610bec57600083815260209020610bec918101908301610bf1565b505050565b6109f091905b80821115610c0b5760008155600101610bf7565b509056fe696e76616c69642073656e6465723b206d757374206265206f776e657200000072656d6f76696e6720746865206c617374206f776e6572206973206e6f7420616c6c6f776564a165627a7a7230582002558c1333a306db96dffcf964f7da37a5f29955f8a2c8b4d695b73a7afa7e670029000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000000004d2130d9d20428dc249a1e938a0bcea4b5b9ac1a000000000000000000000000ff423afeb0e6d997163467b39b7bd192cffd38bc000000000000000000000000ac01f01f51f0bdd012c1838bd5cef330e6c7ffca0000000000000000000000000000000000000000000000000000000000000006302e34312e300000000000000000000000000000000000000000000000000000

    Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000000004d2130d9d20428dc249a1e938a0bcea4b5b9ac1a000000000000000000000000ff423afeb0e6d997163467b39b7bd192cffd38bc000000000000000000000000ac01f01f51f0bdd012c1838bd5cef330e6c7ffca0000000000000000000000000000000000000000000000000000000000000006302e34312e300000000000000000000000000000000000000000000000000000

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [3] : 0000000000000000000000004d2130d9d20428dc249a1e938a0bcea4b5b9ac1a
Arg [4] : 000000000000000000000000ff423afeb0e6d997163467b39b7bd192cffd38bc
Arg [5] : 000000000000000000000000ac01f01f51f0bdd012c1838bd5cef330e6c7ffca
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [7] : 302e34312e300000000000000000000000000000000000000000000000000000


   Swarm Source:
bzzr://02558c1333a306db96dffcf964f7da37a5f29955f8a2c8b4d695b73a7afa7e67

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward