Contract 0x8e93e70d8ac18dbaa38dd557acd4901f843e04e3

Balance:0 ETH
Name:StromkontoProxy

Recent Activity

HashBlockTypeFromToAmount
0x7028d980...178020 callRegistered Customer - x1T SC Stromkonto0 ETH
0x4b12470f...178014 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x6b21ebdc...177974 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xda8d1464...177933 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x9ff87fab...177893 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xe20f4698...177853 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x343d94ab...177814 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xb4455613...177773 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xc6816338...177740 call0x251f4adc1ed82ef49eeb72247540a5be56efddb7 SC Stromkonto0 ETH
0x09949443...177731 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x1f7abe42...177690 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xb387d6e4...177650 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x4f1c5a1e...177609 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x4905a43e...177568 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x384042ee...177531 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x74c7135d...177500 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xbd1491be...177463 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xe5a39143...177425 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x254a922e...177387 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x9301fe3e...177350 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xf4fa4c27...177312 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x97b95926...177271 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x73d9a648...177258 callRegistered Customer - x1T SC Stromkonto0 ETH
0x54970abf...177230 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x1fdafaef...177190 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xe72c4cde...177151 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x1dd91060...177111 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0x576e481a...177071 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH
0xc40eebad...177031 call0x9d28463d51ac40662865d2462e80825d4dbb41d5 SC Stromkonto0 ETH

Code

0x6080604052600436106100f5577c01000000000000000000000000000000000000000000000000000000006000350463184f609381146100fa5780631c2ad7061461013f578063546e428c14610172578063700f55b2146101af57806381ae00a0146101f85780638da5cb5b1461022b578063a2c70c0f1461025c578063a9059cbb14610271578063afd25e7b146102be578063beb2b55d146102f1578063c70515ff14610324578063cc7fc81014610339578063ceae34241461036c578063d7871faa1461039f578063dc43e6f1146103d2578063f2fde38b146103e7578063f4e952791461041a578063fadbcf481461042f575b600080fd5b34801561010657600080fd5b5061012d6004803603602081101561011d57600080fd5b5035600160a060020a0316610462565b60408051918252519081900360200190f35b34801561014b57600080fd5b5061012d6004803603602081101561016257600080fd5b5035600160a060020a0316610474565b34801561017e57600080fd5b506101ad6004803603604081101561019557600080fd5b50600160a060020a0381351690602001351515610486565b005b3480156101bb57600080fd5b506101ad600480360360808110156101d257600080fd5b50600160a060020a038135811691602081013590911690604081013590606001356104c8565b34801561020457600080fd5b506101ad6004803603602081101561021b57600080fd5b5035600160a060020a03166105b6565b34801561023757600080fd5b50610240610603565b60408051600160a060020a039092168252519081900360200190f35b34801561026857600080fd5b50610240610612565b34801561027d57600080fd5b506102aa6004803603604081101561029457600080fd5b50600160a060020a038135169060200135610621565b604080519115158252519081900360200190f35b3480156102ca57600080fd5b5061012d600480360360208110156102e157600080fd5b5035600160a060020a0316610629565b3480156102fd57600080fd5b5061012d6004803603602081101561031457600080fd5b5035600160a060020a031661063b565b34801561033057600080fd5b50610240610656565b34801561034557600080fd5b506101ad6004803603602081101561035c57600080fd5b5035600160a060020a0316610665565b34801561037857600080fd5b5061012d6004803603602081101561038f57600080fd5b5035600160a060020a03166106b3565b3480156103ab57600080fd5b5061012d600480360360208110156103c257600080fd5b5035600160a060020a03166106ce565b3480156103de57600080fd5b5061012d6106e0565b3480156103f357600080fd5b506101ad6004803603602081101561040a57600080fd5b5035600160a060020a03166106e6565b34801561042657600080fd5b5061012d610774565b34801561043b57600080fd5b506102aa6004803603602081101561045257600080fd5b5035600160a060020a031661077a565b60046020526000908152604090205481565b60016020526000908152604090205481565b600054600160a060020a0316331461049d57600080fd5b600160a060020a03919091166000908152600760205260409020805460ff1916911515919091179055565b3360009081526007602052604090205460ff16156105b057600160a060020a03808516600081815260026020818152604080842080548901815560048352818520805489019055958916808552600180845282862080548b0181556003855283872080548b0190558787529754818552838720548388529585529583902054908452965482519687529286015284810188905260608501879052608085019390935260a084019190915260c083019390935260e082019290925290517f1a71774309711c9c0f58692353c6a0789dbdc71f63e2e42a190ab9bc03f79250918190036101000190a15b50505050565b3360009081526007602052604090205460ff1615156001146105d757610600565b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600054600160a060020a031681565b600954600160a060020a031681565b600092915050565b60036020526000908152604090205481565b600160a060020a031660009081526001602052604090205490565b600854600160a060020a031681565b3360009081526007602052604090205460ff16151560011461068657610600565b60088054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600160a060020a031660009081526002602052604090205490565b60026020526000908152604090205481565b60065481565b600054600160a060020a031633146106fd57600080fd5b60005460408051600160a060020a039283168152918316602083015280517ffde8e7d7be5607c2e5922b2a6fdb6106620225daaea86b34e0335c1b673467cc9281900390910190a16000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055481565b60076020526000908152604090205460ff168156fea165627a7a72305820aadd9c56c9b381d7f5e6e17af052a46e0dc22d1f63c0bd0d36f9aedea1d091fc0029

Source

pragma solidity ^0.5.0;
/**
 * StromDAO Business Objects
 * ====================================================================
 * Upper level business objects required for power delivery on a public
 * energy distribution system. Defines PowerDelivery as digital asset
 * used for transaction data and entities (roles) for master data.
 * 
 * @author Thorsten Zoerner <thorsten.zoerner(at)stromdao.de)
 **/


contract owned {
	address public owner;
	event Transfered(address old_owner,address new_owner);
	constructor() public {
		owner = msg.sender;
	}

	modifier onlyOwner {
		if (msg.sender != owner) revert();
		_;
	}
	
	modifier onlyOwnerAsOriginator {
		if (tx.origin != owner) revert();
		_;
	}
	
	function transferOwnership(address newOwner) public onlyOwner {
		emit Transfered(owner,newOwner);
		owner = newOwner;
	}
}

contract StringStorage {
	string public str;
	
	constructor(string memory _str) public {
		str=_str;
	}
}

contract StringStorageBuilder {
	event Built(address _stringStorage);
	
	function build(string memory _str) public returns(address) {
			StringStorage ss = new StringStorage(_str);
			emit Built(address(ss));
			return address(ss);
	}
}


contract DeliveryReceiver is owned {
	RoleLookup public roles;
	DeliveryReceiver public nextReceiver;
	mapping(address=>bool) public monitored;
	
	event Process(address sender,address account,uint256 startTime,uint256 endTime,uint256 power);
	
	constructor(RoleLookup _roles) public {
		roles=_roles;
	}
	

	
	function  monitor(address _account,bool _monitor) internal {
		monitored[_account]=_monitor;    
	}
	function setNextReceiver(DeliveryReceiver _next) onlyOwner public {
		nextReceiver=_next;
	}
}

/**
 * RoleLookup
 * 
 * ====================================================================
 * Provides entity relation model (yellowpages, who-implements-what)
 * to StromDAO Business Objects. A single consensframe must always share
 * a single RoleLookup deployment.
 */
contract RoleLookup {
	mapping(uint256 => uint8) public roles;
	mapping(address=>mapping(uint8=>address)) public relations;
	 mapping(address=>mapping(address=>uint8)) public relationsFrom;
	mapping(uint8=>address) public defaults;
	event Relation(address _from,uint8 _for, address _to);
	
	constructor() public {
		roles[0]= 0;
		roles[1]= 1;
		roles[2]= 2;
		roles[3]= 3;
		roles[4]= 4;
		roles[5]= 5;
	}
	function setDefault(uint8 _role,address _from) public {
		if(msg.sender!=address(0xD87064f2CA9bb2eC333D4A0B02011Afdf39C4fB0)) revert();
		defaults[_role]=_from;
	}
	function setRelation(uint8 _for,address _from) public {
		relations[msg.sender][_for]=_from;
		emit Relation(_from,_for,msg.sender);
	}
	function setRelationFrom(uint8 _for,address _from)  public {
		relationsFrom[msg.sender][_from]=_for;
		emit Relation(_from,_for,msg.sender);
	}
}


contract TxHandler is owned  {
	
	  function addTx(address _from,address _to, uint256 _value,uint256 _base) public onlyOwner {
	  }
	
}

contract Stromkonto is TxHandler {
 
	event Transfer(address indexed _from, address indexed _to, uint256 _value);
	event Tx(address _from,address _to, uint256 _value,uint256 _base,uint256 _from_soll,uint256 _from_haben,uint256 _to_soll,uint256 _to_haben);
	
	mapping (address => uint256) public balancesHaben;
	mapping (address => uint256) public balancesSoll;
	
	mapping (address => uint256) public baseHaben;
	mapping (address => uint256) public baseSoll;
	uint256 public sumTx;
	uint256 public sumBase;
	
	function transfer(address _to, uint256 _value) public returns (bool success) { return false; revert();}
	

	function balanceHaben(address _owner) public returns (uint256 balance) {
		return balancesHaben[_owner];
	}
	
	function balanceSoll(address _owner) public returns (uint256 balance) {
		return balancesSoll[_owner];
	}

	
	function addTx(address _from,address _to, uint256 _value,uint256 _base) public  onlyOwner {
		balancesSoll[_from]+=_value;
		baseSoll[_from]+=_base;
		balancesHaben[_to]+=_value;
		baseHaben[_to]+=_base;
		sumTx+=_value;
		sumBase+=_base;
		emit Tx(_from,_to,_value,_base,balancesSoll[_from],balancesHaben[_from],balancesSoll[_to],balancesHaben[_to]);
	}
	
}

contract Transferable is Stromkonto {
	event Tx(address _from,address _to, uint256 _value,uint256 _base,uint256 _from_soll,uint256 _from_haben,uint256 _to_soll,uint256 _to_haben);
	event Receipt(address _from,address _to,address _msg, uint256 _value,uint256 _base,bool _is_liability);
	
	function addRx(address _to,address _msg, uint256 _value,uint256 _base,bool _is_liability) public   {
		if(_is_liability) {
			balancesSoll[_to]+=_value;
			baseSoll[_to]+=_base;
			balancesHaben[msg.sender]+=_value;
			baseHaben[msg.sender]+=_base;
			emit Tx(_to,msg.sender,_value,_base,balancesSoll[_to],balancesHaben[_to],balancesSoll[msg.sender],balancesHaben[msg.sender]);
		} else {
			balancesSoll[msg.sender]+=_value;
			baseSoll[msg.sender]+=_base;
			balancesHaben[_to]+=_value;
			baseHaben[_to]+=_base;
			emit Tx(msg.sender,_to,_value,_base,balancesSoll[msg.sender],balancesHaben[msg.sender],balancesSoll[_to],balancesHaben[_to]);
		}
		
		sumTx+=_value;
		sumBase+=_base;
		emit Receipt(msg.sender,_to,_msg,_value,_base,_is_liability);
	}
	
}


contract StromkontoProxy is Stromkonto {
		
		mapping(address=>bool) public allowedSenders;
		
		address public receipt_asset;
		address public receipt_liability;
		
		
		constructor() public {
				allowedSenders[msg.sender]=true;
		}
		function modifySender(address _who,bool _allow) public onlyOwner {
				//if(msg.sender!=address(0xD87064f2CA9bb2eC333D4A0B02011Afdf39C4fB0)) throw;
				allowedSenders[_who]=_allow;
		}
		
		function addTx(address _from,address _to, uint256 _value,uint256 _base) public  {
			if(allowedSenders[msg.sender]) {
				balancesSoll[_from]+=_value;
				baseSoll[_from]+=_base;
				balancesHaben[_to]+=_value;
				baseHaben[_to]+=_base;
				emit Tx(_from,_to,_value,_base,balancesSoll[_from],balancesHaben[_from],balancesSoll[_to],balancesHaben[_to]);
			}
		}
		
		function setReceiptAsset(address _address) public {
			if(allowedSenders[msg.sender]!=true) return; 
			receipt_asset=_address;
		}
		
		function setReceiptLiablity(address _address) public {
			if(allowedSenders[msg.sender]!=true) return; 
			receipt_liability=_address;
		}		
}
contract Billing {
	
	event Calculated(address from,address to,uint256 cost);
	address public from;
	address public to;
	uint256 public cost_per_day;
	uint256 public cost_per_energy;
	
	constructor(uint256 _cost_per_day,uint256 _cost_per_energy) public {
		cost_per_day=_cost_per_day;
		cost_per_energy=_cost_per_energy;
	}
	
	function becomeFrom() public {
		if(address(0)!=from) revert();
		from=msg.sender;
	}
	
	function becomeTo() public {
		if(address(0)!=to) revert();
		to=msg.sender;
	}
	

}

contract Connection {
	address public from;
	address public to;
	
	constructor(address _from,address _to) public {
			from=_from;
			to=_to;
	}	
}

contract PricingEnergy {
	uint256 public cost_per_energy;
	
	constructor(uint256 _cost_per_energy) public {			
			cost_per_energy=_cost_per_energy;
	}	
}

contract PricingDay {
	uint256 public cost_per_day;
	
	constructor(uint256 _cost_per_day) public {			
			cost_per_day=_cost_per_day;
	}	
}


contract TXCache is owned {
	
	struct TX {
			address from;
			address to;
			uint256 base;
			uint256 value;
	}
	
	event addedTx(address _from,address _to,uint256 _base,uint256 _value);
	
	TX[] public txs;
	
	function addTx(address _from,address _to,uint256 _base,uint256 _value) public onlyOwner {
			txs.push(TX(_from,_to,_base,_value));
			emit addedTx(_from,_to,_base,_value);
	}
	function length() public returns(uint256)  {
			return txs.length;
	}
	
	function from(uint i) public returns(address) {
			return txs[i].from;
	}
	function to(uint i) public returns(address) {
			return txs[i].to;
	}
	function base(uint i) public returns(uint256) {
			return txs[i].base;
	}
	function value(uint i) public returns(uint256) {
			return txs[i].value;
	}
}


ABI

Constructor

0x608060405234801561001057600080fd5b5060008054600160a060020a0319163390811782558152600760205260409020805460ff191660011790556107bb8061004a6000396000f3fe6080604052600436106100f5577c01000000000000000000000000000000000000000000000000000000006000350463184f609381146100fa5780631c2ad7061461013f578063546e428c14610172578063700f55b2146101af57806381ae00a0146101f85780638da5cb5b1461022b578063a2c70c0f1461025c578063a9059cbb14610271578063afd25e7b146102be578063beb2b55d146102f1578063c70515ff14610324578063cc7fc81014610339578063ceae34241461036c578063d7871faa1461039f578063dc43e6f1146103d2578063f2fde38b146103e7578063f4e952791461041a578063fadbcf481461042f575b600080fd5b34801561010657600080fd5b5061012d6004803603602081101561011d57600080fd5b5035600160a060020a0316610462565b60408051918252519081900360200190f35b34801561014b57600080fd5b5061012d6004803603602081101561016257600080fd5b5035600160a060020a0316610474565b34801561017e57600080fd5b506101ad6004803603604081101561019557600080fd5b50600160a060020a0381351690602001351515610486565b005b3480156101bb57600080fd5b506101ad600480360360808110156101d257600080fd5b50600160a060020a038135811691602081013590911690604081013590606001356104c8565b34801561020457600080fd5b506101ad6004803603602081101561021b57600080fd5b5035600160a060020a03166105b6565b34801561023757600080fd5b50610240610603565b60408051600160a060020a039092168252519081900360200190f35b34801561026857600080fd5b50610240610612565b34801561027d57600080fd5b506102aa6004803603604081101561029457600080fd5b50600160a060020a038135169060200135610621565b604080519115158252519081900360200190f35b3480156102ca57600080fd5b5061012d600480360360208110156102e157600080fd5b5035600160a060020a0316610629565b3480156102fd57600080fd5b5061012d6004803603602081101561031457600080fd5b5035600160a060020a031661063b565b34801561033057600080fd5b50610240610656565b34801561034557600080fd5b506101ad6004803603602081101561035c57600080fd5b5035600160a060020a0316610665565b34801561037857600080fd5b5061012d6004803603602081101561038f57600080fd5b5035600160a060020a03166106b3565b3480156103ab57600080fd5b5061012d600480360360208110156103c257600080fd5b5035600160a060020a03166106ce565b3480156103de57600080fd5b5061012d6106e0565b3480156103f357600080fd5b506101ad6004803603602081101561040a57600080fd5b5035600160a060020a03166106e6565b34801561042657600080fd5b5061012d610774565b34801561043b57600080fd5b506102aa6004803603602081101561045257600080fd5b5035600160a060020a031661077a565b60046020526000908152604090205481565b60016020526000908152604090205481565b600054600160a060020a0316331461049d57600080fd5b600160a060020a03919091166000908152600760205260409020805460ff1916911515919091179055565b3360009081526007602052604090205460ff16156105b057600160a060020a03808516600081815260026020818152604080842080548901815560048352818520805489019055958916808552600180845282862080548b0181556003855283872080548b0190558787529754818552838720548388529585529583902054908452965482519687529286015284810188905260608501879052608085019390935260a084019190915260c083019390935260e082019290925290517f1a71774309711c9c0f58692353c6a0789dbdc71f63e2e42a190ab9bc03f79250918190036101000190a15b50505050565b3360009081526007602052604090205460ff1615156001146105d757610600565b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600054600160a060020a031681565b600954600160a060020a031681565b600092915050565b60036020526000908152604090205481565b600160a060020a031660009081526001602052604090205490565b600854600160a060020a031681565b3360009081526007602052604090205460ff16151560011461068657610600565b60088054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600160a060020a031660009081526002602052604090205490565b60026020526000908152604090205481565b60065481565b600054600160a060020a031633146106fd57600080fd5b60005460408051600160a060020a039283168152918316602083015280517ffde8e7d7be5607c2e5922b2a6fdb6106620225daaea86b34e0335c1b673467cc9281900390910190a16000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055481565b60076020526000908152604090205460ff168156fe

Current contract state

FunctionResult