Address Contract Partially Verified
Address
0xDB13025b219dB5e4529f48b65Ff009a26B6Ae733
Balance
0 ETH
Nonce
1
Code Size
6557 bytes
Creator
0xE2d9b825...5185 at tx 0x35b75b0f...88245a
Indexed Transactions
0
Contract Bytecode
6557 bytes
0x60806040526004361061020e5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146102db5780630918d47a14610365578063095ea7b3146103965780630d92e3e8146103ce578063151f0a90146103f5578063162cbefe1461040a57806318160ddd1461041f57806323b872dd146104345780632a11ced01461045e578063313ce56714610476578063324536eb146104a157806334ac6f5e146104b657806337dac678146104cb578063385d545e146104e05780633baf4899146104f557806354fd4d501461050a5780635eaaa6991461051f5780635ed7ca5b146105345780636161eb181461054b578063664e97041461056f5780636d6a6a4d1461058457806370a082311461059957806373889f4a146105ba5780637572f479146105cf578063788ce6f2146105e457806379c65068146105f95780638132044f1461061d5780638c86f0a7146106325780638da5cb5b14610653578063902d55a51461066857806395d89b411461067d578063a22b35ce14610692578063a9059cbb146106b6578063b6f50c29146106da578063b9b8af0b146106fb578063cb3e64fd14610710578063dd62ed3e14610725578063ee6f9dbc1461074c578063ee9b4152146107da578063f2fde38b146107ef578063f315b70d14610810578063fb6e655814610825578063fd1fc4a014610846575b60018054810190819055600090361561022657600080fd5b6000341161023357600080fd5b610245346103e863ffffffff61089d16565b336000908152600f6020526040902054909250610268908363ffffffff6108d316565b336000908152600f602052604090205560065461028b908363ffffffff6108d316565b60065560008054604051600160a060020a03909116913480156108fc02929091818181858888f193505050501580156102c8573d6000803e3d6000fd5b5060015481146102d757600080fd5b5050005b3480156102e757600080fd5b506102f06108e2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561032a578181015183820152602001610312565b50505050905090810190601f1680156103575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037157600080fd5b5061037a610970565b60408051600160a060020a039092168252519081900360200190f35b3480156103a257600080fd5b506103ba600160a060020a0360043516602435610988565b604080519115158252519081900360200190f35b3480156103da57600080fd5b506103e36109ee565b60408051918252519081900360200190f35b34801561040157600080fd5b5061037a6109f4565b34801561041657600080fd5b506103e3610a0c565b34801561042b57600080fd5b506103e3610a12565b34801561044057600080fd5b506103ba600160a060020a0360043581169060243516604435610a18565b34801561046a57600080fd5b5061037a600435610b7f565b34801561048257600080fd5b5061048b610ba7565b6040805160ff9092168252519081900360200190f35b3480156104ad57600080fd5b506103e3610bac565b3480156104c257600080fd5b506103e3610bb2565b3480156104d757600080fd5b506103e3610bb8565b3480156104ec57600080fd5b506103e3610bbe565b34801561050157600080fd5b5061037a610bc4565b34801561051657600080fd5b506102f0610bdc565b34801561052b57600080fd5b506103e3610c37565b34801561054057600080fd5b50610549610c47565b005b34801561055757600080fd5b50610549600160a060020a0360043516602435610c6d565b34801561057b57600080fd5b506103e3610d92565b34801561059057600080fd5b506103e3610d98565b3480156105a557600080fd5b506103e3600160a060020a0360043516610da4565b3480156105c657600080fd5b506103e3610dbf565b3480156105db57600080fd5b5061037a610dc5565b3480156105f057600080fd5b5061037a610ddd565b34801561060557600080fd5b50610549600160a060020a0360043516602435610dec565b34801561062957600080fd5b5061037a610e89565b34801561063e57600080fd5b506103ba600160a060020a0360043516610ea1565b34801561065f57600080fd5b5061037a610eb6565b34801561067457600080fd5b506103e3610ec5565b34801561068957600080fd5b506102f0610ed5565b34801561069e57600080fd5b50610549600160a060020a0360043516602435610f30565b3480156106c257600080fd5b506103ba600160a060020a0360043516602435611108565b3480156106e657600080fd5b50610549600160a060020a0360043516611231565b34801561070757600080fd5b506103ba611333565b34801561071c57600080fd5b5061054961133c565b34801561073157600080fd5b506103e3600160a060020a0360043581169060243516611370565b34801561075857600080fd5b506040805160206004803580820135838102808601850190965280855261054995369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061139b9650505050505050565b3480156107e657600080fd5b506103e3611655565b3480156107fb57600080fd5b50610549600160a060020a0360043516611661565b34801561081c57600080fd5b506103e36116f5565b34801561083157600080fd5b506103e3600160a060020a03600435166116fb565b34801561085257600080fd5b506040805160206004803580820135838102808601850190965280855261054995369593946024949385019291829185019084908082843750949750509335945061170d9350505050565b6000808315156108b057600091506108cc565b508282028284828115156108c057fe5b04146108c857fe5b8091505b5092915050565b6000828201838110156108c857fe5b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109685780601f1061093d57610100808354040283529160200191610968565b820191906000526020600020905b81548152906001019060200180831161094b57829003601f168201915b505050505081565b73ac762012330350ddd97cc64b133536f8e32193a881565b336000818152601060209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600c5481565b73de59297bf5d1d1b9d38d8f50e55a270eb9ae136e81565b60085481565b60065490565b6000600160a060020a0383161515610a2f57600080fd5b600160a060020a0384166000908152600f6020526040902054821115610a5457600080fd5b600160a060020a0384166000908152601060209081526040808320338452909152902054821115610a8457600080fd5b600160a060020a0384166000908152600f6020526040902054610aad908363ffffffff61193f16565b600160a060020a038086166000908152600f60205260408082209390935590851681522054610ae2908363ffffffff6108d316565b600160a060020a038085166000908152600f60209081526040808320949094559187168152601082528281203382529091522054610b26908363ffffffff61193f16565b600160a060020a0380861660008181526010602090815260408083203384528252918290209490945580518681529051928716939192600080516020611952833981519152929181900390910190a35060019392505050565b600d805482908110610b8d57fe5b600091825260209091200154600160a060020a0316905081565b601281565b60065481565b60075481565b600a5481565b600b5481565b73e2d9b8259f74a46b5e3f74a30c7867be0a5f518581565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109685780601f1061093d57610100808354040283529160200191610968565b6b043355b53628a6b59400000081565b600054600160a060020a03163314610c5e57600080fd5b6002805460ff19166001179055565b600054600160a060020a03163314610c8457600080fd5b336000908152600f6020526040902054811115610ca057600080fd5b336000818152600f6020908152604091829020805485900390556006805485900390558151928352820183905280517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a1600160a060020a0382161515610d0e57600080fd5b600654610d21908263ffffffff61193f16565b600655600160a060020a0382166000908152600f6020526040902054610d4d908263ffffffff61193f16565b600160a060020a0383166000818152600f6020908152604080832094909455835185815293519193600080516020611952833981519152929081900390910190a35050565b6103e881565b670de0b6b3a764000081565b600160a060020a03166000908152600f602052604090205490565b600d5490565b739888375f4663891770daaaf9286d97d44fefc82e81565b600e54600160a060020a031681565b600054600160a060020a03163314610e0357600080fd5b600160a060020a038083166000908152600f602090815260408083208054860190556006805486019055825481518681529151941693600080516020611952833981519152929181900390910190a3600054604080518381529051600160a060020a03808616931691600080516020611952833981519152919081900360200190a35050565b7328970854bfa61c0d6fe56cc9daaae5271ceaec0981565b60116020526000908152604090205460ff1681565b600054600160a060020a031681565b6b204fce5e3e2502611000000081565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109685780601f1061093d57610100808354040283529160200191610968565b600054600160a060020a03163314610f4757600080fd5b600160a060020a0382166000908152600f6020526040902054811115610f6c57600080fd5b600160a060020a0382166000908152601060209081526040808320338452909152902054811115610f9c57600080fd5b600160a060020a0382166000818152600f602090815260408083208054869003905560108252808320338452825291829020805485900390556006805485900390558151928352820183905280517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a1600160a060020a0382166000908152601060209081526040808320338452909152902054611048908263ffffffff61193f16565b600160a060020a038316600081815260106020908152604080832033845282529182902093909355805191825291810183905281517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5929181900390910190a1600160a060020a0382166000818152601060209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35050565b336000908152600f6020526040812054811061112357600080fd5b336000908152600f602052604090205482111561113f57600080fd5b600160a060020a038316151561115457600080fd5b6000821161116157600080fd5b600160a060020a03831633141561117757600080fd5b336000908152600f602052604090205482111561119357600080fd5b336000908152600f60205260409020546111b3908363ffffffff61193f16565b336000908152600f602052604080822092909255600160a060020a038516815220546111e5908363ffffffff6108d316565b600160a060020a0384166000818152600f60209081526040918290209390935580518581529051919233926000805160206119528339815191529281900390910190a350600192915050565b600054600160a060020a0316331461124857600080fd5b600160a060020a038116151561125d57600080fd5b600e54600160a060020a03161561127357600080fd5b61129b6b204fce5e3e250261100000006b043355b53628a6b59400000063ffffffff61193f16565b600654146112a857600080fd5b600160a060020a0381166000818152600f602090815260408083206b043355b53628a6b5940000009081905581519081529051600080516020611952833981519152929181900390910190a3600e805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556b204fce5e3e25026110000000600655565b60025460ff1681565b600054600160a060020a0316331461135357600080fd5b60025460ff16151561136457600080fd5b6002805460ff19169055565b600160a060020a03918216600090815260106020908152604080832093909416825291909152205490565b6000805481908190600160a060020a031633146113b757600080fd5b600054600160a060020a031633146113ce57600080fd5b83518551146113dc57600080fd5b8351670de0b6b3a7640000908590839081106113f457fe5b90602001906020020151029250600090505b845181101561164e5760116000868381518110151561142157fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff1615156114f957600160116000878481518110151561146157fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905584516114d7908690839081106114a557fe5b602090810290910101518551670de0b6b3a7640000908790859081106114c757fe5b9060200190602002015102611108565b15156114e257600080fd5b6114f2828463ffffffff6108d316565b9150611552565b848181518110151561150757fe5b90602001906020020151600160a060020a03167f3506b32cea6b36a739c1c2a71a9e1b3d6222104389c07219059fa6eb6d2e0563836040518082815260200191505060405180910390a25b600854611565908363ffffffff61193f16565b600855600c5461157b908363ffffffff6108d316565b600c819055507fa0078abe206b24dc2673adfbca6433fddc4aa887eca9fd15557c29f3b74922e68585600c54604051808060200180602001848152602001838103835286818151815260200191508051906020019060200280838360005b838110156115f15781810151838201526020016115d9565b50505050905001838103825285818151815260200191508051906020019060200280838360005b83811015611630578181015183820152602001611618565b505050509050019550505050505060405180910390a1600101611406565b5050505050565b67016345785d8a000081565b600054600160a060020a0316331461167857600080fd5b600160a060020a038116151561168d57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60095481565b60126020526000908152604090205481565b6000805481908190600160a060020a0316331461172957600080fd5b6000841161173657600080fd5b5050670de0b6b3a7640000820260005b84518110156118825760116000868381518110151561176157fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff1615156118215760016011600087848151811015156117a157fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905584516117ff908690839081106117e557fe5b60209081029091010151670de0b6b3a76400008402611108565b151561180a57600080fd5b61181a838363ffffffff6108d316565b925061187a565b848181518110151561182f57fe5b90602001906020020151600160a060020a03167f3506b32cea6b36a739c1c2a71a9e1b3d6222104389c07219059fa6eb6d2e0563846040518082815260200191505060405180910390a25b600101611746565b600854611895908463ffffffff61193f16565b600855600c546118ab908463ffffffff6108d316565b600c819055507f71dae88d65232818f63a7ceb3e8fb3ebbf4ac03c9ae6c5d896d3832147c100cd8585600c546040518080602001848152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561192357818101518382015260200161190b565b5050505090500194505050505060405180910390a15050505050565b60008282111561194b57fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058201c5731f585faeaa66f531489bc95cdf75f22b95e03a38f5a224e307089b0f0540029
Verified Source Code Partial Match
Compiler: v0.4.25+commit.59dbf8f1
EVM: byzantium
Optimization: Yes (200 runs)
Ubricoin.sol 594 lines
pragma solidity ^0.4.25;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function balanceOf(address _owner) external view returns (uint256);
function allowance(address _owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner=0xE2d9b8259F74a46b5E3f74A30c7867be0a5f5185;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() internal {
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));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
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;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
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 a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Helps contracts guard against reentrancy attacks.
* @author Remco Bloemen <remco@2π.com>, Eenae <[email protected]>
* @dev If you mark a function `nonReentrant`, you should also
* mark it `external`.
*/
contract ReentrancyGuard {
/// @dev counter to allow mutex lock with only one SSTORE operation
uint256 private _guardCounter;
constructor() internal {
// The counter starts at one to prevent changing it from zero to a non-zero
// value, which is a more expensive operation.
_guardCounter = 1;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_guardCounter += 1;
uint256 localCounter = _guardCounter;
_;
require(localCounter == _guardCounter);
}
}
contract Haltable is Ownable {
bool public halted;
modifier stopInEmergency {
if (halted) revert();
_;
}
modifier stopNonOwnersInEmergency {
if (halted && msg.sender != owner) revert();
_;
}
modifier onlyInEmergency {
if (!halted) revert();
_;
}
// called by the owner on emergency, triggers stopped state
function halt() external onlyOwner {
halted = true;
}
// called by the owner on end of emergency, returns to normal state
function unhalt() external onlyOwner onlyInEmergency {
halted = false;
}
}
contract Ubricoin is IERC20,Ownable,ReentrancyGuard,Haltable{
using SafeMath for uint256;
// UBN Token parameters
string public name = 'Ubricoin';
string public symbol = 'UBN';
string public version = '2.0';
uint256 public constant RATE = 1000; //1 ether = 1000 Ubricoins tokens
// min tokens to be a holder, 0.1
uint256 public constant MIN_HOLDER_TOKENS = 10 ** uint256(decimals - 1);
// 18 decimals is the strongly suggested default, avoid changing it
uint8 public constant decimals = 18;
uint256 public constant decimalFactor = 10 ** uint256(decimals);
uint256 public totalSupply_; // amount of tokens already sold/supply
uint256 public constant TOTAL_SUPPLY = 10000000000 * decimalFactor; // The initialSupply or totalSupply of 100% Released at Token Distribution (TD)
uint256 public constant SALES_SUPPLY = 1300000000 * decimalFactor; // 2.30% Released at Token Distribution (TD)
// Funds supply constants // tokens to be Distributed at every stage
uint256 public AVAILABLE_FOUNDER_SUPPLY = 1500000000 * decimalFactor; // 17.3% Released at TD
uint256 public AVAILABLE_AIRDROP_SUPPLY = 2000000000 * decimalFactor; // 22.9% Released at TD/Eco System Allocated
uint256 public AVAILABLE_OWNER_SUPPLY = 2000000000 * decimalFactor; // 22.9% Released at TD
uint256 public AVAILABLE_TEAMS_SUPPLY = 3000000000 * decimalFactor; // 34.5% Released at TD
uint256 public AVAILABLE_BONUS_SUPPLY = 200000000 * decimalFactor; // 0.10% Released at TD
uint256 public claimedTokens = 0;
// Funds supply addresses constants // tokens distribution
address public constant AVAILABLE_FOUNDER_SUPPLY_ADDRESS = 0xAC762012330350DDd97Cc64B133536F8E32193a8; //AVAILABLE_FOUNDER_SUPPLY_ADDRESS 1
address public constant AVAILABLE_AIRDROP_SUPPLY_ADDRESS = 0x28970854Bfa61C0d6fE56Cc9daAAe5271CEaEC09; //AVAILABLE_AIRDROP_SUPPLY_ADDRESS 2 Eco system Allocated
address public constant AVAILABLE_OWNER_SUPPLY_ADDRESS = 0xE2d9b8259F74a46b5E3f74A30c7867be0a5f5185; //AVAILABLE_OWNER_SUPPLY_ADDRESS 3
address public constant AVAILABLE_BONUS_SUPPLY_ADDRESS = 0xDE59297Bf5D1D1b9d38D8F50e55A270eb9aE136e; //AVAILABLE_BONUS1_SUPPLY_ADDRESS 4
address public constant AVAILABLE_TEAMS_SUPPLY_ADDRESS = 0x9888375f4663891770DaaaF9286d97d44FeFC82E; //AVAILABLE_RESERVE_TEAM_SUPPLY_ADDRESS 5
// Token holders
address[] public holders;
// ICO address
address public icoAddress;
mapping (address => uint256) balances; // This creates an array with all balances
mapping (address => mapping (address => uint256)) internal allowed;
// Keeps track of whether or not an Ubricoin airdrop has been made to a particular address
mapping (address => bool) public airdrops;
mapping (address => uint256) public holderNumber; // Holders number
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event TransferredToken(address indexed to, uint256 value);
event FailedTransfer(address indexed to, uint256 value);
// This notifies clients about the amount burnt , only admin is able to burn the contract
event Burn(address from, uint256 value);
event AirDropped ( address[] _recipient, uint256 _amount, uint256 claimedTokens);
event AirDrop_many ( address[] _recipient, uint256[] _amount, uint256 claimedTokens);
/**
* @dev Constructor that gives a portion of all existing tokens to various addresses.
* @dev Distribute founder, airdrop,owner, reserve_team and bonus_supply tokens
* @dev and Ico address for the remaining tokens
*/
constructor () public {
// Allocate tokens to the available_founder_supply_address fund 1
balances[AVAILABLE_FOUNDER_SUPPLY_ADDRESS] = AVAILABLE_FOUNDER_SUPPLY;
holders.push(AVAILABLE_FOUNDER_SUPPLY_ADDRESS);
emit Transfer(0x0, AVAILABLE_FOUNDER_SUPPLY_ADDRESS, AVAILABLE_FOUNDER_SUPPLY);
// Allocate tokens to the available_airdrop_supply_address fund 2 eco system allocated
balances[AVAILABLE_AIRDROP_SUPPLY_ADDRESS] = AVAILABLE_AIRDROP_SUPPLY;
holders.push(AVAILABLE_AIRDROP_SUPPLY_ADDRESS);
emit Transfer(0x0, AVAILABLE_AIRDROP_SUPPLY_ADDRESS, AVAILABLE_AIRDROP_SUPPLY);
// Allocate tokens to the available_owner_supply_address fund 3
balances[AVAILABLE_OWNER_SUPPLY_ADDRESS] = AVAILABLE_OWNER_SUPPLY;
holders.push(AVAILABLE_OWNER_SUPPLY_ADDRESS);
emit Transfer(0x0, AVAILABLE_OWNER_SUPPLY_ADDRESS, AVAILABLE_OWNER_SUPPLY);
// Allocate tokens to the available_reserve_team_supply_address fund 4
balances[AVAILABLE_TEAMS_SUPPLY_ADDRESS] = AVAILABLE_TEAMS_SUPPLY;
holders.push(AVAILABLE_TEAMS_SUPPLY_ADDRESS);
emit Transfer(0x0, AVAILABLE_TEAMS_SUPPLY_ADDRESS, AVAILABLE_TEAMS_SUPPLY);
// Allocate tokens to the available_reserve_team_supply_address fund 5
balances[AVAILABLE_BONUS_SUPPLY_ADDRESS] = AVAILABLE_BONUS_SUPPLY;
holders.push(AVAILABLE_BONUS_SUPPLY_ADDRESS);
emit Transfer(0x0, AVAILABLE_BONUS_SUPPLY_ADDRESS, AVAILABLE_BONUS_SUPPLY);
totalSupply_ = TOTAL_SUPPLY.sub(SALES_SUPPLY);
}
/**
* @dev Function fallback/payable to buy tokens from contract by sending ether.
* @notice Buy tokens from contract by sending ether
* @dev This are the tokens allocated for sale's supply
*/
function () payable nonReentrant external {
require(msg.data.length == 0);
require(msg.value > 0);
uint256 tokens = msg.value.mul(RATE); // calculates the aamount
balances[msg.sender] = balances[msg.sender].add(tokens);
totalSupply_ = totalSupply_.add(tokens);
owner.transfer(msg.value); //make transfer
}
/**
* @dev set ICO address and allocate sale supply to it
* Tokens left for payment using ethers
*/
function setICO(address _icoAddress) public onlyOwner {
require(_icoAddress != address(0));
require(icoAddress == address(0));
require(totalSupply_ == TOTAL_SUPPLY.sub(SALES_SUPPLY));
// Allocate tokens to the ico contract
balances[_icoAddress] = SALES_SUPPLY;
emit Transfer(0x0, _icoAddress, SALES_SUPPLY);
icoAddress = _icoAddress;
totalSupply_ = TOTAL_SUPPLY;
}
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining ) {
return allowed[_owner][_spender];
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint256 _value) internal {
require(_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(balances[_from] >= _value); // Check if the sender has enough
require(balances[_to] + _value >= balances[_to]); // Check for overflows
uint256 previousBalances = balances[_from] + balances[_to]; // Save this for an assertion in the future
balances[_from] -= _value; // Subtract from the sender
balances[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balances[_from] + balances[_to] == previousBalances);
}
/**
* Standard transfer function
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balances[msg.sender] > 0);
require(balances[msg.sender] >= _value); // Check if the sender has enough
require(_to != address(0x0)); // Prevent transfer to 0x0 address. Use burn() instead
require(_value > 0);
require(_to != msg.sender); // Check if sender and receiver is not same
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value); // Subtract value from sender
balances[_to] = balances[_to].add(_value); // Add the value to the receiver
emit Transfer(msg.sender, _to, _value); // Notify all clients about the transfer events
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0x0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]); // Check allowance
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
// get holders count
function getHoldersCount() public view returns (uint256) {
return holders.length;
}
// preserve holders list
function preserveHolders(address _from, address _to, uint256 _value) internal {
if (balances[_from].sub(_value) < MIN_HOLDER_TOKENS)
removeHolder(_from);
if (balances[_to].add(_value) >= MIN_HOLDER_TOKENS)
addHolder(_to);
}
// remove holder from the holders list
function removeHolder(address _holder) internal {
uint256 _number = holderNumber[_holder];
if (_number == 0 || holders.length == 0 || _number > holders.length)
return;
uint256 _index = _number.sub(1);
uint256 _lastIndex = holders.length.sub(1);
address _lastHolder = holders[_lastIndex];
if (_index != _lastIndex) {
holders[_index] = _lastHolder;
holderNumber[_lastHolder] = _number;
}
holderNumber[_holder] = 0;
holders.length = _lastIndex;
}
// add holder to the holders list
function addHolder(address _holder) internal {
if (holderNumber[_holder] == 0) {
holders.push(_holder);
holderNumber[_holder] = holders.length;
}
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) external onlyOwner {
require(balances[msg.sender] >= value); // Check if the sender has enough
balances[msg.sender] -= value; // Subtract from the sender
totalSupply_ -= value; // Updates totalSupply
emit Burn(msg.sender, value);
//return true;
require(account != address(0x0));
totalSupply_ = totalSupply_.sub(value);
balances[account] = balances[account].sub(value);
emit Transfer(account, address(0X0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) external onlyOwner {
require(balances[account] >= value); // Check if the targeted balance is enough
require(value <= allowed[account][msg.sender]); // Check allowance
balances[account] -= value; // Subtract from the targeted balance
allowed[account][msg.sender] -= value; // Subtract from the sender's allowance
totalSupply_ -= value; // Update totalSupply
emit Burn(account, value);
// return true;
allowed[account][msg.sender] = allowed[account][msg.sender].sub(value);
emit Burn(account, value);
emit Approval(account, msg.sender, allowed[account][msg.sender]);
}
function validPurchase() internal returns (bool) {
bool lessThanMaxInvestment = msg.value <= 1000 ether; // change the value to whatever you need
return validPurchase() && lessThanMaxInvestment;
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param target The account that will receive the created tokens.
* @param mintedAmount The amount that will be created.
* @dev perform a minting/create new UBN's for new allocations
* @param target is the address to mint tokens to
*
*/
function mintToken(address target, uint256 mintedAmount) public onlyOwner {
balances[target] += mintedAmount;
totalSupply_ += mintedAmount;
emit Transfer(0, owner, mintedAmount);
emit Transfer(owner, target, mintedAmount);
}
/**
* @dev perform a transfer of allocations
* @param _recipient is a list of recipients
*
* Below function can be used when you want to send every recipeint with different number of tokens
*
*/
function airDrop_many(address[] _recipient, uint256[] _amount) public onlyOwner {
require(msg.sender == owner);
require(_recipient.length == _amount.length);
uint256 amount = _amount[i] * uint256(decimalFactor);
uint256 airdropped;
for (uint i=0; i < _recipient.length; i++) {
if (!airdrops[_recipient[i]]) {
airdrops[_recipient[i]] = true;
require(Ubricoin.transfer(_recipient[i], _amount[i] * decimalFactor));
//Ubricoin.transfer(_recipient[i], _amount[i]);
airdropped = airdropped.add(amount );
} else{
emit FailedTransfer(_recipient[i], airdropped);
}
AVAILABLE_AIRDROP_SUPPLY = AVAILABLE_AIRDROP_SUPPLY.sub(airdropped);
//totalSupply_ = totalSupply_.sub(airdropped);
claimedTokens = claimedTokens.add(airdropped);
emit AirDrop_many(_recipient, _amount, claimedTokens);
}
}
/**
* @dev perform a transfer of allocations
* @param _recipient is a list of recipients
*
* this function can be used when you want to send same number of tokens to all the recipients
*
*/
function airDrop(address[] _recipient, uint256 _amount) public onlyOwner {
require(_amount > 0);
uint256 airdropped;
uint256 amount = _amount * uint256(decimalFactor);
for (uint256 index = 0; index < _recipient.length; index++) {
if (!airdrops[_recipient[index]]) {
airdrops[_recipient[index]] = true;
require(Ubricoin.transfer(_recipient[index], amount * decimalFactor ));
airdropped = airdropped.add(amount );
}else{
emit FailedTransfer(_recipient[index], airdropped);
}
}
AVAILABLE_AIRDROP_SUPPLY = AVAILABLE_AIRDROP_SUPPLY.sub(airdropped);
//totalSupply_ = totalSupply_.sub(airdropped);
claimedTokens = claimedTokens.add(airdropped);
emit AirDropped(_recipient, _amount, claimedTokens);
}
}
Read Contract
AVAILABLE_AIRDROP_SUPPLY 0x162cbefe → uint256
AVAILABLE_AIRDROP_SUPPLY_ADDRESS 0x8132044f → address
AVAILABLE_BONUS_SUPPLY 0x385d545e → uint256
AVAILABLE_BONUS_SUPPLY_ADDRESS 0x151f0a90 → address
AVAILABLE_FOUNDER_SUPPLY 0x34ac6f5e → uint256
AVAILABLE_FOUNDER_SUPPLY_ADDRESS 0x0918d47a → address
AVAILABLE_OWNER_SUPPLY 0xf315b70d → uint256
AVAILABLE_OWNER_SUPPLY_ADDRESS 0x3baf4899 → address
AVAILABLE_TEAMS_SUPPLY 0x37dac678 → uint256
AVAILABLE_TEAMS_SUPPLY_ADDRESS 0x7572f479 → address
MIN_HOLDER_TOKENS 0xee9b4152 → uint256
RATE 0x664e9704 → uint256
SALES_SUPPLY 0x5eaaa699 → uint256
TOTAL_SUPPLY 0x902d55a5 → uint256
airdrops 0x8c86f0a7 → bool
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
claimedTokens 0x0d92e3e8 → uint256
decimalFactor 0x6d6a6a4d → uint256
decimals 0x313ce567 → uint8
getHoldersCount 0x73889f4a → uint256
halted 0xb9b8af0b → bool
holderNumber 0xfb6e6558 → uint256
holders 0x2a11ced0 → address
icoAddress 0x788ce6f2 → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
totalSupply_ 0x324536eb → uint256
version 0x54fd4d50 → string
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
_burn 0x6161eb18
address account
uint256 value
_burnFrom 0xa22b35ce
address account
uint256 value
airDrop 0xfd1fc4a0
address[] _recipient
uint256 _amount
airDrop_many 0xee6f9dbc
address[] _recipient
uint256[] _amount
approve 0x095ea7b3
address _spender
uint256 _value
returns: bool
halt 0x5ed7ca5b
No parameters
mintToken 0x79c65068
address target
uint256 mintedAmount
setICO 0xb6f50c29
address _icoAddress
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unhalt 0xcb3e64fd
No parameters
Token Balances (2)
View Transfers →Recent Transactions
No transactions found for this address