updates in smart and interface...: waiting for Interface...
This commit is contained in:
parent
c09cc964b6
commit
d436a345f1
|
@ -3,10 +3,10 @@ pragma solidity ^0.4.18;
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// 'DECA' DEcentralized CArbon tokens - ITDE (initial token distribution event)
|
// 'DECA' DEcentralized CArbon tokens - ITDE (initial token distribution event)
|
||||||
//
|
//
|
||||||
// Deployed to : 0x639A1c28d2d32587d6294067deb982E229b8C132
|
// Deployed to : 0x4fBE079198ce239fB02E967578aACB28C0CE31ef
|
||||||
// Network : Rinkeby
|
// Network : Ropsten
|
||||||
// Symbol : DECA
|
// Symbol : DECA
|
||||||
// Name : DEcentralized CArbon tokens
|
// Name : Decentralized Carbon tokens
|
||||||
// Total supply: Gazillion
|
// Total supply: Gazillion
|
||||||
// Decimals : 18
|
// Decimals : 18
|
||||||
//
|
//
|
||||||
|
@ -41,10 +41,10 @@ contract SafeMath {
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// ERC Token Standard #20 Interface
|
// DECA Token Standard #20 Interface
|
||||||
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
|
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
contract ERC20Interface {
|
contract DECAInterface {
|
||||||
function totalSupply() public constant returns (uint);
|
function totalSupply() public constant returns (uint);
|
||||||
function balanceOf(address tokenOwner) public constant returns (uint balance);
|
function balanceOf(address tokenOwner) public constant returns (uint balance);
|
||||||
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
|
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
|
||||||
|
@ -73,7 +73,9 @@ contract ApproveAndCallFallBack {
|
||||||
contract Owned {
|
contract Owned {
|
||||||
address public owner;
|
address public owner;
|
||||||
address public newOwner;
|
address public newOwner;
|
||||||
uint public _totalCarbonCredits;
|
//this is the ipfs orbit database address as Half1+Half2 strings
|
||||||
|
string public _CCDBAddress;
|
||||||
|
//uint public _CarbonCreditsDBAddress;
|
||||||
|
|
||||||
event OwnershipTransferred(address indexed _from, address indexed _to);
|
event OwnershipTransferred(address indexed _from, address indexed _to);
|
||||||
|
|
||||||
|
@ -86,9 +88,8 @@ contract Owned {
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateCC(uint newCC) public onlyOwner {
|
function updateCCDBAddress(string CCDBAddress) public onlyOwner {
|
||||||
_totalCarbonCredits = newCC;
|
_CCDBAddress = CCDBAddress;
|
||||||
// _totalCarbonCredits = safeAdd(_totalCarbonCredits, newCC);
|
|
||||||
}
|
}
|
||||||
function transferOwnership(address _newOwner) public onlyOwner {
|
function transferOwnership(address _newOwner) public onlyOwner {
|
||||||
newOwner = _newOwner;
|
newOwner = _newOwner;
|
||||||
|
@ -106,7 +107,7 @@ contract Owned {
|
||||||
// ERC20 Token, with the addition of symbol, name and decimals and assisted
|
// ERC20 Token, with the addition of symbol, name and decimals and assisted
|
||||||
// token transfers
|
// token transfers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
contract DECAToken is ERC20Interface, Owned, SafeMath {
|
contract DECAToken is DECAInterface, Owned, SafeMath {
|
||||||
string public symbol;
|
string public symbol;
|
||||||
string public name;
|
string public name;
|
||||||
uint8 public decimals;
|
uint8 public decimals;
|
||||||
|
@ -126,7 +127,7 @@ contract DECAToken is ERC20Interface, Owned, SafeMath {
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
constructor () public {
|
constructor () public {
|
||||||
symbol = "DECA";
|
symbol = "DECA";
|
||||||
name = "DEcentralized CArbon tokens";
|
name = "Decentralized Carbon tokens";
|
||||||
decimals = 18;
|
decimals = 18;
|
||||||
//for testing change weeks for days...
|
//for testing change weeks for days...
|
||||||
preICOEnds = now + 1 days;
|
preICOEnds = now + 1 days;
|
||||||
|
@ -230,16 +231,16 @@ contract DECAToken is ERC20Interface, Owned, SafeMath {
|
||||||
uint toSender;
|
uint toSender;
|
||||||
uint percentage;
|
uint percentage;
|
||||||
|
|
||||||
percentage = 10; // percentage that goes to the owner
|
percentage = 50; // percentage that goes to the owner 25% to carbon credits fund
|
||||||
|
|
||||||
if (now <= preICOEnds) {
|
if (now <= preICOEnds) {
|
||||||
tokens = msg.value * 20000;
|
tokens = msg.value * 2000;
|
||||||
} else if (now > preICOEnds && now <= bonus1Ends ) {
|
} else if (now > preICOEnds && now <= bonus1Ends ) {
|
||||||
tokens = msg.value * 15000;
|
tokens = msg.value * 1500;
|
||||||
} else if (now > bonus1Ends && now <= bonus2Ends) {
|
} else if (now > bonus1Ends && now <= bonus2Ends) {
|
||||||
tokens = msg.value * 12500;
|
tokens = msg.value * 1250;
|
||||||
} else {
|
} else {
|
||||||
tokens = msg.value * 10000;
|
tokens = msg.value * 1000;
|
||||||
}
|
}
|
||||||
toOwner = tokens / percentage; // percentage assigned to the contract owner (DAO)
|
toOwner = tokens / percentage; // percentage assigned to the contract owner (DAO)
|
||||||
toSender = tokens; // tokens goes to sender
|
toSender = tokens; // tokens goes to sender
|
||||||
|
@ -256,7 +257,7 @@ contract DECAToken is ERC20Interface, Owned, SafeMath {
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Owner can transfer out any accidentally sent ERC20 tokens
|
// Owner can transfer out any accidentally sent ERC20 tokens
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
|
function transferAnyDECAToken(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
|
||||||
return ERC20Interface(tokenAddress).transfer(owner, tokens);
|
return DECAInterface(tokenAddress).transfer(owner, tokens);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue