Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 4202369 | 3116 days ago | 0.01 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xaAa6C933...D177fd355 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Reservation
Compiler Version
v0.4.15+commit.bbb8e64f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2017-08-25
*/
/**
* This reservation contract accepts investments, which will be sent to the ICO contract as soon as it starts buy calling buyTokens().
* Investors may withdraw their funds anytime if they change their mind as long as the tokens have not yet been purchased.
* Author: Julia Altenried
* Internal audit: Alex Bazhanau, Andrej Ruckij
* Audit: Blockchain & Smart Contract Security Group
**/
pragma solidity ^0.4.15;
contract ICO {
function invest(address receiver) payable {}
}
contract SafeMath {
function safeAdd(uint a, uint b) internal returns(uint) {
uint c = a + b;
assert(c >= a && c >= b);
return c;
}
}
contract owned {
address public owner;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function owned() {
owner = msg.sender;
}
function changeOwner(address newOwner) onlyOwner {
owner = newOwner;
}
}
contract mortal is owned {
function close() onlyOwner {
require(address(this).balance == 0);
selfdestruct(owner);
}
}
contract Reservation is mortal, SafeMath {
ICO public ico;
address[] public investors;
mapping(address => uint) public balanceOf;
mapping(address => bool) invested;
/** constructs an investment contract for an ICO contract **/
function Reservation(address _icoAddr) {
ico = ICO(_icoAddr);
}
/** make an investment **/
function() payable {
if (msg.value > 0) {
if (!invested[msg.sender]) {
investors.push(msg.sender);
invested[msg.sender] = true;
}
balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], msg.value);
}
}
/** buys tokens in behalf of the investors by calling the ico contract
* starting with the investor at index from and ending with investor at index to.
* This function will be called as soon as the ICO starts and as often as necessary, until all investments were made. **/
function buyTokens(uint _from, uint _to) onlyOwner {
require(address(ico)!=0x0);//would fail anyway below, but to be sure
uint amount;
if (_to > investors.length)
_to = investors.length;
for (uint i = _from; i < _to; i++) {
if (balanceOf[investors[i]] > 0) {
amount = balanceOf[investors[i]];
delete balanceOf[investors[i]];
ico.invest.value(amount)(investors[i]);
}
}
}
/** In case an investor wants to retrieve his or her funds he or she can call this function.
* (only possible before tokens are bought) **/
function withdraw() {
uint amount = balanceOf[msg.sender];
require(amount > 0);
balanceOf[msg.sender] = 0;
msg.sender.transfer(amount);
}
/** returns the number of investors **/
function getNumInvestors() constant returns(uint) {
return investors.length;
}
function setICO(address _icoAddr) onlyOwner {
ico = ICO(_icoAddr);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"investors","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"close","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"ico","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getNumInvestors","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"uint256"},{"name":"_to","type":"uint256"}],"name":"buyTokens","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_icoAddr","type":"address"}],"name":"setICO","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_icoAddr","type":"address"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"}]Contract Creation Code
0x6060604052341561000f57600080fd5b604051602080610793833981016040528080519150505b5b60008054600160a060020a03191633600160a060020a03161790555b60018054600160a060020a031916600160a060020a0383161790555b505b610723806100706000396000f300606060405236156100a15763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633ccfd60b81146101695780633feb5f2b1461017e57806343d726d6146101b05780635d452201146101c557806370a08231146101f457806372ea4b8c146102255780637975ce281461024a5780638da5cb5b14610265578063a6f9dae114610294578063b6f50c29146102b5575b5b600034111561016657600160a060020a03331660009081526004602052604090205460ff1615156101295760028054600181016100df83826106ac565b916000526020600020900160005b8154600160a060020a033381166101009390930a838102910219909116179091556000908152600460205260409020805460ff19166001179055505b600160a060020a03331660009081526003602052604090205461014c90346102d6565b600160a060020a0333166000908152600360205260409020555b5b005b341561017457600080fd5b6101666102fe565b005b341561018957600080fd5b61019460043561036b565b604051600160a060020a03909116815260200160405180910390f35b34156101bb57600080fd5b61016661039d565b005b34156101d057600080fd5b6101946103de565b604051600160a060020a03909116815260200160405180910390f35b34156101ff57600080fd5b610213600160a060020a03600435166103ed565b60405190815260200160405180910390f35b341561023057600080fd5b6102136103ff565b60405190815260200160405180910390f35b341561025557600080fd5b610166600435602435610406565b005b341561027057600080fd5b61019461060d565b604051600160a060020a03909116815260200160405180910390f35b341561029f57600080fd5b610166600160a060020a036004351661061c565b005b34156102c057600080fd5b610166600160a060020a0360043516610664565b005b60008282018381108015906102eb5750828110155b15156102f357fe5b8091505b5092915050565b600160a060020a03331660009081526003602052604081205490811161032357600080fd5b600160a060020a0333166000818152600360205260408082209190915582156108fc0290839051600060405180830381858888f19350505050151561036757600080fd5b5b50565b600280548290811061037957fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b60005433600160a060020a039081169116146103b857600080fd5b600160a060020a03301631156103cd57600080fd5b600054600160a060020a0316ff5b5b565b600154600160a060020a031681565b60036020526000908152604090205481565b6002545b90565b60008054819033600160a060020a0390811691161461042457600080fd5b600154600160a060020a0316151561043b57600080fd5b60025483111561044b5760025492505b50825b828110156106055760006003600060028481548110151561046b57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020019081526020016000205411156105fc57600360006002838154811015156104c557fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020019081526020016000205491506003600060028381548110151561051b57fe5b906000526020600020900160005b9054600160a060020a036101009290920a90048116825260208201929092526040016000908120556001546002805491909216916303f9c793918591908590811061057057fe5b906000526020600020900160005b9054906101000a9004600160a060020a03166040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390911660048201526024016000604051808303818588803b15156105e657600080fd5b6125ee5a03f115156105f757600080fd5b505050505b5b60010161044e565b5b5b50505050565b600054600160a060020a031681565b60005433600160a060020a0390811691161461063757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60005433600160a060020a0390811691161461067f57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b8154818355818115116106d0576000838152602090206106d09181019083016106d6565b5b505050565b61040391905b808211156106f057600081556001016106dc565b5090565b905600a165627a7a72305820520c04452e3326b63c3b27dbd411a460dca101f342e46d59efbf43c3e7f102f700290000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x606060405236156100a15763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633ccfd60b81146101695780633feb5f2b1461017e57806343d726d6146101b05780635d452201146101c557806370a08231146101f457806372ea4b8c146102255780637975ce281461024a5780638da5cb5b14610265578063a6f9dae114610294578063b6f50c29146102b5575b5b600034111561016657600160a060020a03331660009081526004602052604090205460ff1615156101295760028054600181016100df83826106ac565b916000526020600020900160005b8154600160a060020a033381166101009390930a838102910219909116179091556000908152600460205260409020805460ff19166001179055505b600160a060020a03331660009081526003602052604090205461014c90346102d6565b600160a060020a0333166000908152600360205260409020555b5b005b341561017457600080fd5b6101666102fe565b005b341561018957600080fd5b61019460043561036b565b604051600160a060020a03909116815260200160405180910390f35b34156101bb57600080fd5b61016661039d565b005b34156101d057600080fd5b6101946103de565b604051600160a060020a03909116815260200160405180910390f35b34156101ff57600080fd5b610213600160a060020a03600435166103ed565b60405190815260200160405180910390f35b341561023057600080fd5b6102136103ff565b60405190815260200160405180910390f35b341561025557600080fd5b610166600435602435610406565b005b341561027057600080fd5b61019461060d565b604051600160a060020a03909116815260200160405180910390f35b341561029f57600080fd5b610166600160a060020a036004351661061c565b005b34156102c057600080fd5b610166600160a060020a0360043516610664565b005b60008282018381108015906102eb5750828110155b15156102f357fe5b8091505b5092915050565b600160a060020a03331660009081526003602052604081205490811161032357600080fd5b600160a060020a0333166000818152600360205260408082209190915582156108fc0290839051600060405180830381858888f19350505050151561036757600080fd5b5b50565b600280548290811061037957fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b60005433600160a060020a039081169116146103b857600080fd5b600160a060020a03301631156103cd57600080fd5b600054600160a060020a0316ff5b5b565b600154600160a060020a031681565b60036020526000908152604090205481565b6002545b90565b60008054819033600160a060020a0390811691161461042457600080fd5b600154600160a060020a0316151561043b57600080fd5b60025483111561044b5760025492505b50825b828110156106055760006003600060028481548110151561046b57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020019081526020016000205411156105fc57600360006002838154811015156104c557fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020019081526020016000205491506003600060028381548110151561051b57fe5b906000526020600020900160005b9054600160a060020a036101009290920a90048116825260208201929092526040016000908120556001546002805491909216916303f9c793918591908590811061057057fe5b906000526020600020900160005b9054906101000a9004600160a060020a03166040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390911660048201526024016000604051808303818588803b15156105e657600080fd5b6125ee5a03f115156105f757600080fd5b505050505b5b60010161044e565b5b5b50505050565b600054600160a060020a031681565b60005433600160a060020a0390811691161461063757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60005433600160a060020a0390811691161461067f57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b8154818355818115116106d0576000838152602090206106d09181019083016106d6565b5b505050565b61040391905b808211156106f057600081556001016106dc565b5090565b905600a165627a7a72305820520c04452e3326b63c3b27dbd411a460dca101f342e46d59efbf43c3e7f102f70029
Swarm Source
bzzr://520c04452e3326b63c3b27dbd411a460dca101f342e46d59efbf43c3e7f102f7
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.