Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 4749150 | 2998 days ago | Contract Creation | 0 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 0x37592E02...5F3feD85C The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
LightFundsRegistry
Compiler Version
v0.4.18+commit.9cf6e910
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2017-12-17
*/
pragma solidity ^0.4.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ReentrancyGuard {
/**
* @dev We use a single lock for the whole contract.
*/
bool private rentrancy_lock = false;
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* @notice If you mark a function `nonReentrant`, you should also
* mark it `external`. Calling one nonReentrant function from
* another is not supported. Instead, you can implement a
* `private` function doing the actual work, and a `external`
* wrapper marked as `nonReentrant`.
*/
modifier nonReentrant() {
require(!rentrancy_lock);
rentrancy_lock = true;
_;
rentrancy_lock = false;
}
}
contract ArgumentsChecker {
/// @dev check which prevents short address attack
modifier payloadSizeIs(uint size) {
require(msg.data.length == size + 4 /* function selector */);
_;
}
/// @dev check that address is valid
modifier validAddress(address addr) {
require(addr != address(0));
_;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() 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 transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract LightFundsRegistry is ArgumentsChecker, Ownable, ReentrancyGuard {
using SafeMath for uint256;
enum State {
// gathering funds
GATHERING,
// returning funds to investors
REFUNDING,
// funds sent to owners
SUCCEEDED
}
event StateChanged(State _state);
event Invested(address indexed investor, uint256 amount);
event EtherSent(address indexed to, uint value);
event RefundSent(address indexed to, uint value);
modifier requiresState(State _state) {
require(m_state == _state);
_;
}
// PUBLIC interface
function LightFundsRegistry(address owner80, address owner20)
public
validAddress(owner80)
validAddress(owner20)
{
m_owner80 = owner80;
m_owner20 = owner20;
}
/// @dev performs only allowed state transitions
function changeState(State _newState)
external
onlyOwner
{
assert(m_state != _newState);
if (State.GATHERING == m_state) { assert(State.REFUNDING == _newState || State.SUCCEEDED == _newState); }
else assert(false);
m_state = _newState;
StateChanged(m_state);
if (State.SUCCEEDED == _newState) {
uint _80percent = this.balance.mul(80).div(100);
m_owner80.transfer(_80percent);
EtherSent(m_owner80, _80percent);
uint _20percent = this.balance;
m_owner20.transfer(_20percent);
EtherSent(m_owner20, _20percent);
}
}
/// @dev records an investment
function invested(address _investor)
external
payable
onlyOwner
requiresState(State.GATHERING)
{
uint256 amount = msg.value;
require(0 != amount);
// register investor
if (0 == m_weiBalances[_investor])
m_investors.push(_investor);
// register payment
totalInvested = totalInvested.add(amount);
m_weiBalances[_investor] = m_weiBalances[_investor].add(amount);
Invested(_investor, amount);
}
/// @notice withdraw accumulated balance, called by payee in case crowdsale has failed
function withdrawPayments(address payee)
external
nonReentrant
onlyOwner
requiresState(State.REFUNDING)
{
uint256 payment = m_weiBalances[payee];
require(payment != 0);
require(this.balance >= payment);
totalInvested = totalInvested.sub(payment);
m_weiBalances[payee] = 0;
payee.transfer(payment);
RefundSent(payee, payment);
}
function getInvestorsCount() external view returns (uint) { return m_investors.length; }
// FIELDS
/// @notice total amount of investments in wei
uint256 public totalInvested;
/// @notice state of the registry
State public m_state = State.GATHERING;
/// @dev balances of investors in wei
mapping(address => uint256) public m_weiBalances;
/// @dev list of unique investors
address[] public m_investors;
address public m_owner80;
address public m_owner20;
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[],"name":"m_owner80","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newState","type":"uint8"}],"name":"changeState","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"payee","type":"address"}],"name":"withdrawPayments","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"m_weiBalances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalInvested","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_investor","type":"address"}],"name":"invested","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"m_state","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"m_owner20","outputs":[{"name":"","type":"address"}],"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":"","type":"uint256"}],"name":"m_investors","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInvestorsCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"owner80","type":"address"},{"name":"owner20","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_state","type":"uint8"}],"name":"StateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"investor","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Invested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"EtherSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"RefundSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]Contract Creation Code
0x60606040526000805460a060020a60ff02191690556002805460ff19169055341561002957600080fd5b6040516040806109d8833981016040528080519190602001805160008054600160a060020a03191633600160a060020a03908116919091179091559092508391508116151561007757600080fd5b81600160a060020a038116151561008d57600080fd5b505060058054600160a060020a03938416600160a060020a0319918216179091556006805492909316911617905561090e806100ca6000396000f3006060604052600436106100b95763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630429323681146100be578063268f1153146100ed57806331b3eb94146101085780634ffcfefe146101275780635216aeec1461015857806366b3f6bf1461016b5780636f4d80e51461017f578063834b1aa1146101b65780638da5cb5b146101c9578063d85edab6146101dc578063ed21187a146101f2578063f2fde38b14610205575b600080fd5b34156100c957600080fd5b6100d1610224565b604051600160a060020a03909116815260200160405180910390f35b34156100f857600080fd5b61010660ff60043516610233565b005b341561011357600080fd5b610106600160a060020a036004351661045c565b341561013257600080fd5b610146600160a060020a03600435166105eb565b60405190815260200160405180910390f35b341561016357600080fd5b6101466105fd565b610106600160a060020a0360043516610603565b341561018a57600080fd5b610192610746565b604051808260028111156101a257fe5b60ff16815260200191505060405180910390f35b34156101c157600080fd5b6100d161074f565b34156101d457600080fd5b6100d161075e565b34156101e757600080fd5b6100d160043561076d565b34156101fd57600080fd5b610146610795565b341561021057600080fd5b610106600160a060020a036004351661079c565b600554600160a060020a031681565b60008054819033600160a060020a0390811691161461025157600080fd5b82600281111561025d57fe5b6002805460ff169081111561026e57fe5b141561027657fe5b6002805460ff169081111561028757fe5b15156102bf5782600281111561029957fe5b600114806102b257508260028111156102ae57fe5b6002145b15156102ba57fe5b6102c1565bfe5b6002805484919060ff1916600183838111156102d957fe5b02179055506002547f551dc40198cc79684bb69e4931dba4ac16e4598792ee1c0a5000aeea366d7bb69060ff166040518082600281111561031657fe5b60ff16815260200191505060405180910390a182600281111561033557fe5b6002141561045757610369606461035d600160a060020a03301631605063ffffffff61083716565b9063ffffffff61086d16565b600554909250600160a060020a031682156108fc0283604051600060405180830381858888f19350505050151561039f57600080fd5b600554600160a060020a03167f6109e2559dfa766aaec7118351d48a523f0a4157f49c8d68749c8ac41318ad128360405190815260200160405180910390a250600654600160a060020a0330811631911681156108fc0282604051600060405180830381858888f19350505050151561041757600080fd5b600654600160a060020a03167f6109e2559dfa766aaec7118351d48a523f0a4157f49c8d68749c8ac41318ad128260405190815260200160405180910390a25b505050565b6000805474010000000000000000000000000000000000000000900460ff161561048557600080fd5b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179081905533600160a060020a039081169116146104d457600080fd5b6001806002805460ff16908111156104e857fe5b146104f257600080fd5b600160a060020a038316600090815260036020526040902054915081151561051957600080fd5b600160a060020a033016318290101561053157600080fd5b600154610544908363ffffffff61088416565b600155600160a060020a0383166000818152600360205260408082209190915583156108fc0290849051600060405180830381858888f19350505050151561058b57600080fd5b82600160a060020a03167fe309aa15fd2f6bd8a58603632508694071e7d35e967bdbb827926e429b7ef34d8360405190815260200160405180910390a250506000805474ff00000000000000000000000000000000000000001916905550565b60036020526000908152604090205481565b60015481565b6000805433600160a060020a0390811691161461061f57600080fd5b6000806002805460ff169081111561063357fe5b1461063d57600080fd5b34915081151561064c57600080fd5b600160a060020a03831660009081526003602052604090205415156106b057600480546001810161067d83826108a5565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161790555b6001546106c3908363ffffffff61089616565b600155600160a060020a0383166000908152600360205260409020546106ef908363ffffffff61089616565b600160a060020a0384166000818152600360205260409081902092909255907fc3f75dfc78f6efac88ad5abb5e606276b903647d97b2a62a1ef89840a658bbc39084905190815260200160405180910390a2505050565b60025460ff1681565b600654600160a060020a031681565b600054600160a060020a031681565b600480548290811061077b57fe5b600091825260209091200154600160a060020a0316905081565b6004545b90565b60005433600160a060020a039081169116146107b757600080fd5b600160a060020a03811615156107cc57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008083151561084a5760009150610866565b5082820282848281151561085a57fe5b041461086257fe5b8091505b5092915050565b600080828481151561087b57fe5b04949350505050565b60008282111561089057fe5b50900390565b60008282018381101561086257fe5b8154818355818115116104575760008381526020902061045791810190830161079991905b808211156108de57600081556001016108ca565b50905600a165627a7a723058203d52d975e3dada9e8d4d46497748cbcd737ec3de44f8273a8ce5a4d7e3042ee300290000000000000000000000002c4c6c02d486f95fd943424d450a047ab11283d9000000000000000000000000d7e74c47580718af17080fdcf26cf3fdc1233bc4
Deployed Bytecode
0x6060604052600436106100b95763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630429323681146100be578063268f1153146100ed57806331b3eb94146101085780634ffcfefe146101275780635216aeec1461015857806366b3f6bf1461016b5780636f4d80e51461017f578063834b1aa1146101b65780638da5cb5b146101c9578063d85edab6146101dc578063ed21187a146101f2578063f2fde38b14610205575b600080fd5b34156100c957600080fd5b6100d1610224565b604051600160a060020a03909116815260200160405180910390f35b34156100f857600080fd5b61010660ff60043516610233565b005b341561011357600080fd5b610106600160a060020a036004351661045c565b341561013257600080fd5b610146600160a060020a03600435166105eb565b60405190815260200160405180910390f35b341561016357600080fd5b6101466105fd565b610106600160a060020a0360043516610603565b341561018a57600080fd5b610192610746565b604051808260028111156101a257fe5b60ff16815260200191505060405180910390f35b34156101c157600080fd5b6100d161074f565b34156101d457600080fd5b6100d161075e565b34156101e757600080fd5b6100d160043561076d565b34156101fd57600080fd5b610146610795565b341561021057600080fd5b610106600160a060020a036004351661079c565b600554600160a060020a031681565b60008054819033600160a060020a0390811691161461025157600080fd5b82600281111561025d57fe5b6002805460ff169081111561026e57fe5b141561027657fe5b6002805460ff169081111561028757fe5b15156102bf5782600281111561029957fe5b600114806102b257508260028111156102ae57fe5b6002145b15156102ba57fe5b6102c1565bfe5b6002805484919060ff1916600183838111156102d957fe5b02179055506002547f551dc40198cc79684bb69e4931dba4ac16e4598792ee1c0a5000aeea366d7bb69060ff166040518082600281111561031657fe5b60ff16815260200191505060405180910390a182600281111561033557fe5b6002141561045757610369606461035d600160a060020a03301631605063ffffffff61083716565b9063ffffffff61086d16565b600554909250600160a060020a031682156108fc0283604051600060405180830381858888f19350505050151561039f57600080fd5b600554600160a060020a03167f6109e2559dfa766aaec7118351d48a523f0a4157f49c8d68749c8ac41318ad128360405190815260200160405180910390a250600654600160a060020a0330811631911681156108fc0282604051600060405180830381858888f19350505050151561041757600080fd5b600654600160a060020a03167f6109e2559dfa766aaec7118351d48a523f0a4157f49c8d68749c8ac41318ad128260405190815260200160405180910390a25b505050565b6000805474010000000000000000000000000000000000000000900460ff161561048557600080fd5b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179081905533600160a060020a039081169116146104d457600080fd5b6001806002805460ff16908111156104e857fe5b146104f257600080fd5b600160a060020a038316600090815260036020526040902054915081151561051957600080fd5b600160a060020a033016318290101561053157600080fd5b600154610544908363ffffffff61088416565b600155600160a060020a0383166000818152600360205260408082209190915583156108fc0290849051600060405180830381858888f19350505050151561058b57600080fd5b82600160a060020a03167fe309aa15fd2f6bd8a58603632508694071e7d35e967bdbb827926e429b7ef34d8360405190815260200160405180910390a250506000805474ff00000000000000000000000000000000000000001916905550565b60036020526000908152604090205481565b60015481565b6000805433600160a060020a0390811691161461061f57600080fd5b6000806002805460ff169081111561063357fe5b1461063d57600080fd5b34915081151561064c57600080fd5b600160a060020a03831660009081526003602052604090205415156106b057600480546001810161067d83826108a5565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161790555b6001546106c3908363ffffffff61089616565b600155600160a060020a0383166000908152600360205260409020546106ef908363ffffffff61089616565b600160a060020a0384166000818152600360205260409081902092909255907fc3f75dfc78f6efac88ad5abb5e606276b903647d97b2a62a1ef89840a658bbc39084905190815260200160405180910390a2505050565b60025460ff1681565b600654600160a060020a031681565b600054600160a060020a031681565b600480548290811061077b57fe5b600091825260209091200154600160a060020a0316905081565b6004545b90565b60005433600160a060020a039081169116146107b757600080fd5b600160a060020a03811615156107cc57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008083151561084a5760009150610866565b5082820282848281151561085a57fe5b041461086257fe5b8091505b5092915050565b600080828481151561087b57fe5b04949350505050565b60008282111561089057fe5b50900390565b60008282018381101561086257fe5b8154818355818115116104575760008381526020902061045791810190830161079991905b808211156108de57600081556001016108ca565b50905600a165627a7a723058203d52d975e3dada9e8d4d46497748cbcd737ec3de44f8273a8ce5a4d7e3042ee30029
Swarm Source
bzzr://3d52d975e3dada9e8d4d46497748cbcd737ec3de44f8273a8ce5a4d7e3042ee3
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 ]
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.