Fountain 3
ERC20
This contract is an ERC20 token.
Name
Fountain 3
Symbol
FTN
Decimals
18
Total Supply
2,208,919,511 FTN
About
link
description
Fountain (FTN) is a cryptocurrency token and operates on the Ethereum platform. Fountain has a current supply of 2,208,919,510.99 with 88,674,657.89 in circulation. The last known price of Fountain is $0.013140 USD and is up 0.69% over the last 24 hours. It is currently trading on 2 active market(s) with $84,191.63 traded over the last 24 hours. More information can be found at https://fountainhub.com.
Stats
Public Functions
48
Event Types
20
Code Size
26,714 bytes
Events (20) keyboard_arrow_up
Functions
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function transferOwnership (address newOwner) public onlyOwner returns (bool) {
require(newOwner != address(0));
require(newOwner != owner);
require(newOwner != foundationOwner);
require(wallets[owner] == 0);
require(wallets[newOwner] == 0);
address oldOwner = owner;
owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
return true;
}
setFountainFoundationOwner keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function setFountainFoundationOwner (address newFoundationOwner) public onlyOwner returns (bool) {
require(newFoundationOwner != address(0));
require(newFoundationOwner != foundationOwner);
require(newFoundationOwner != owner);
require(wallets[newFoundationOwner] == 0);
address oldFoundation = foundationOwner;
foundationOwner = newFoundationOwner;
emit FoundationOwnershipTransferred(oldFoundation, foundationOwner);
uint256 all = wallets[oldFoundation];
wallets[oldFoundation] -= all;
wallets[newFoundationOwner] = all;
emit Transfer(oldFoundation, newFoundationOwner, all);
return true;
}
pause keyboard_arrow_up
pause keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function pause (uint256 from, uint256 to) public onlyOwner {
require(to > from);
pauseFrom = from;
pauseTo = to;
emit ContractPauseSchedule(from, to);
}
resume keyboard_arrow_up
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Modifiers help
Source Code
function transfer (address target, uint256 value) public whenRunning canTransfer(msg.sender, target, value) returns (bool) {
require(target != owner);
require(canPay(msg.sender, value));
wallets[msg.sender] = wallets[msg.sender].sub(value);
wallets[target] = wallets[target].add(value);
emit Transfer(msg.sender, target, value);
return true;
}
transferFrom keyboard_arrow_up
Modifiers help
Source Code
function transferFrom (address from, address to, uint256 value) public whenRunning canTransfer(from, to, value) returns (bool) {
require(from != owner);
require(to != owner);
require(canPay(from, value));
uint256 warrant;
if (msg.sender != from) {
warrant = warrants[from][msg.sender];
require(value <= warrant);
warrants[from][msg.sender] = warrant.sub(value);
}
wallets[from] = wallets[from].sub(value);
wallets[to] = wallets[to].add(value);
emit Transfer(from, to, value);
return true;
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Modifiers help
Source Code
function approve (address delegator, uint256 value) public whenRunning returns (bool) {
if (delegator == msg.sender) return true;
warrants[msg.sender][delegator] = value;
emit Approval(msg.sender, delegator, value);
return true;
}
increaseApproval keyboard_arrow_up
Modifiers help
Source Code
function increaseApproval (address delegator, uint256 delta) public whenRunning returns (bool) {
if (delegator == msg.sender) return true;
uint256 value = warrants[msg.sender][delegator].add(delta);
warrants[msg.sender][delegator] = value;
emit Approval(msg.sender, delegator, value);
return true;
}
decreaseApproval keyboard_arrow_up
Modifiers help
Source Code
function decreaseApproval (address delegator, uint256 delta) public whenRunning returns (bool) {
if (delegator == msg.sender) return true;
uint256 value = warrants[msg.sender][delegator];
if (value < delta) {
value = 0;
}
else {
value = value.sub(delta);
}
warrants[msg.sender][delegator] = value;
emit Approval(msg.sender, delegator, value);
return true;
}
invest keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
whenRunning checks for the following:
canInvest checks for the following:
Requirements help
null
Source Code
function invest (address investor, uint256 amount) public onlyOwner whenRunning canInvest returns (bool) {
require(investor != address(0));
require(investor != owner);
require(investor != foundationOwner);
require(amount > 0);
require(canMint(amount));
mapping(uint => LockBin) locks = lockbins[investor];
LockBin storage info = locks[0];
uint index = info.amount + 1;
locks[index] = LockBin({
start: releaseStart,
finish: releaseStart + releaseDuration,
duration: releaseDuration / (1 days),
amount: amount
});
info.amount = index;
token_created = token_created.add(amount);
wallets[investor] = wallets[investor].add(amount);
emit Mint(investor, amount);
emit Transfer(address(0), investor, amount);
return true;
}
getInvestedToken keyboard_arrow_up
Requirements help
Source Code
function getInvestedToken (address investor) public view returns (uint256) {
require(investor != address(0) && investor != owner && investor != foundationOwner);
mapping(uint => LockBin) locks = lockbins[investor];
uint256 balance = 0;
uint l = locks[0].amount;
for (uint i = 1; i <= l; i ++) {
LockBin memory bin = locks[i];
balance = balance.add(bin.amount);
}
return balance;
}
getLockedToken keyboard_arrow_up
Requirements help
Source Code
function getLockedToken (address investor) public view returns (uint256) {
require(investor != address(0) && investor != owner && investor != foundationOwner);
mapping(uint => LockBin) locks = lockbins[investor];
uint256 balance = 0;
uint256 d = 1;
uint l = locks[0].amount;
for (uint i = 1; i <= l; i ++) {
LockBin memory bin = locks[i];
if (now <= bin.start) {
balance = balance.add(bin.amount);
}
else if (now < bin.finish) {
d = (now - bin.start) / (1 days);
balance = balance.add(bin.amount - bin.amount * d / bin.duration);
}
}
return balance;
}
availableWallet keyboard_arrow_up
changeCap keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function changeCap (uint256 _cap) public onlyOwner returns (bool) {
if (_cap < token_created && _cap > 0) return false;
token_cap = _cap;
return true;
}
canMint keyboard_arrow_up
startForge keyboard_arrow_up
stopForge keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyOwner checks for the following:
canForge checks for the following:
forge_running must be true
Source Code
function stopForge () public onlyOwner canForge returns (bool) {
forge_running = false;
emit ForgeStop();
return true;
}
totalFountainSupply keyboard_arrow_up
mint keyboard_arrow_up
Modifiers help
hasMintability checks for the following:
One or more of the following:
-
foundationOwner
must be equal to
the sender's address
- OR
owner
must be equal to
the sender's address
whenRunning checks for the following:
canForge checks for the following:
forge_running must be true
Requirements help
Source Code
function mint (address target, uint256 amount) public hasMintability whenRunning canForge returns (bool) {
require(target != owner && target != foundationOwner);
require(canMint(amount));
if (msg.sender == foundationOwner) {
require(canMintFoundation(amount));
token_foundation_created = token_foundation_created.add(amount);
}
token_created = token_created.add(amount);
wallets[target] = wallets[target].add(amount);
emit Mint(target, amount);
emit Transfer(address(0), target, amount);
return true;
}
burn keyboard_arrow_up
Modifiers help
whenRunning checks for the following:
canForge checks for the following:
forge_running must be true
Source Code
function burn (uint256 amount) public whenRunning canForge returns (bool) {
uint256 balance = availableWallet(msg.sender);
require(amount <= balance);
token_created = token_created.sub(amount);
wallets[msg.sender] = wallets[msg.sender].sub(amount);
emit Burn(msg.sender, amount);
emit Transfer(msg.sender, address(0), amount);
return true;
}
pauseInvest keyboard_arrow_up
resumeInvest keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
Requirements help
forceStopInvest must be true
Source Code
function resumeInvest () public onlyOwner whenRunning returns (bool) {
require(forceStopInvest);
forceStopInvest = false;
emit InvestStart();
return true;
}
setInvest keyboard_arrow_up
Modifiers help
Requirements help
Source Code
function setInvest (uint256 release_start, uint256 release_duration) public onlyOwner whenRunning returns (bool) {
releaseStart = release_start;
releaseDuration = release_duration;
require(releaseStart + releaseDuration > releaseStart);
forceStopInvest = false;
emit NewInvest(release_start, release_duration);
return true;
}
batchInvest keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
whenRunning checks for the following:
canInvest checks for the following:
Requirements help
Source Code
function batchInvest (address[] investors, uint256 amount) public onlyOwner whenRunning canInvest returns (bool) {
require(amount > 0);
uint investorsLength = investors.length;
uint investorsCount = 0;
uint i;
address r;
for (i = 0; i < investorsLength; i ++) {
r = investors[i];
if (r == address(0) || r == owner || r == foundationOwner) continue;
investorsCount ++;
}
require(investorsCount > 0);
uint256 totalAmount = amount.mul(uint256(investorsCount));
require(canMint(totalAmount));
token_created = token_created.add(totalAmount);
for (i = 0; i < investorsLength; i ++) {
r = investors[i];
if (r == address(0) || r == owner || r == foundationOwner) continue;
mapping(uint => LockBin) locks = lockbins[r];
LockBin storage info = locks[0];
uint index = info.amount + 1;
locks[index] = LockBin({
start: releaseStart,
finish: releaseStart + releaseDuration,
duration: releaseDuration / (1 days),
amount: amount
});
info.amount = index;
wallets[r] = wallets[r].add(amount);
emit Mint(r, amount);
emit Transfer(address(0), r, amount);
}
return true;
}
batchInvests keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
whenRunning checks for the following:
canInvest checks for the following:
Requirements help
null
Source Code
function batchInvests (address[] investors, uint256[] amounts) public onlyOwner whenRunning canInvest returns (bool) {
uint investorsLength = investors.length;
require(investorsLength == amounts.length);
uint investorsCount = 0;
uint256 totalAmount = 0;
uint i;
address r;
for (i = 0; i < investorsLength; i ++) {
r = investors[i];
if (r == address(0) || r == owner || r == foundationOwner) continue;
investorsCount ++;
totalAmount = totalAmount.add(amounts[i]);
}
require(totalAmount > 0);
require(canMint(totalAmount));
uint256 amount;
token_created = token_created.add(totalAmount);
for (i = 0; i < investorsLength; i ++) {
r = investors[i];
if (r == address(0) || r == owner || r == foundationOwner) continue;
amount = amounts[i];
if (amount == 0) continue;
wallets[r] = wallets[r].add(amount);
emit Mint(r, amount);
emit Transfer(address(0), r, amount);
mapping(uint => LockBin) locks = lockbins[r];
LockBin storage info = locks[0];
uint index = info.amount + 1;
locks[index] = LockBin({
start: releaseStart,
finish: releaseStart + releaseDuration,
duration: releaseDuration / (1 days),
amount: amount
});
info.amount = index;
}
return true;
}
batchTransfer keyboard_arrow_up
Modifiers help
Requirements help
Source Code
function batchTransfer (address[] receivers, uint256 amount) public whenRunning returns (bool) {
require(amount > 0);
uint receiveLength = receivers.length;
uint receiverCount = 0;
uint i;
address r;
for (i = 0; i < receiveLength; i ++) {
r = receivers[i];
if (r == address(0) || r == owner) continue;
receiverCount ++;
}
require(receiverCount > 0);
uint256 totalAmount = amount.mul(uint256(receiverCount));
require(canPay(msg.sender, totalAmount));
wallets[msg.sender] = wallets[msg.sender].sub(totalAmount);
for (i = 0; i < receiveLength; i++) {
r = receivers[i];
if (r == address(0) || r == owner) continue;
wallets[r] = wallets[r].add(amount);
emit Transfer(msg.sender, r, amount);
}
return true;
}
batchTransfers keyboard_arrow_up
Modifiers help
Requirements help
null
Source Code
function batchTransfers (address[] receivers, uint256[] amounts) public whenRunning returns (bool) {
uint receiveLength = receivers.length;
require(receiveLength == amounts.length);
uint receiverCount = 0;
uint256 totalAmount = 0;
uint i;
address r;
for (i = 0; i < receiveLength; i ++) {
r = receivers[i];
if (r == address(0) || r == owner) continue;
receiverCount ++;
totalAmount = totalAmount.add(amounts[i]);
}
require(totalAmount > 0);
require(canPay(msg.sender, totalAmount));
wallets[msg.sender] = wallets[msg.sender].sub(totalAmount);
uint256 amount;
for (i = 0; i < receiveLength; i++) {
r = receivers[i];
if (r == address(0) || r == owner) continue;
amount = amounts[i];
if (amount == 0) continue;
wallets[r] = wallets[r].add(amount);
emit Transfer(msg.sender, r, amount);
}
return true;
}
batchTransferFrom keyboard_arrow_up
Modifiers help
Requirements help
null
Source Code
function batchTransferFrom (address from, address[] receivers, uint256 amount) public whenRunning returns (bool) {
require(from != address(0) && from != owner);
require(amount > 0);
uint receiveLength = receivers.length;
uint receiverCount = 0;
uint i;
address r;
for (i = 0; i < receiveLength; i ++) {
r = receivers[i];
if (r == address(0) || r == owner) continue;
receiverCount ++;
}
require(receiverCount > 0);
uint256 totalAmount = amount.mul(uint256(receiverCount));
require(canPay(from, totalAmount));
uint256 warrant;
if (msg.sender != from) {
warrant = warrants[from][msg.sender];
require(totalAmount <= warrant);
warrants[from][msg.sender] = warrant.sub(totalAmount);
}
wallets[from] = wallets[from].sub(totalAmount);
for (i = 0; i < receiveLength; i++) {
r = receivers[i];
if (r == address(0) || r == owner) continue;
wallets[r] = wallets[r].add(amount);
emit Transfer(from, r, amount);
}
return true;
}
batchTransferFroms keyboard_arrow_up
Modifiers help
Requirements help
null
Source Code
function batchTransferFroms (address from, address[] receivers, uint256[] amounts) public whenRunning returns (bool) {
require(from != address(0) && from != owner);
uint receiveLength = receivers.length;
require(receiveLength == amounts.length);
uint receiverCount = 0;
uint256 totalAmount = 0;
uint i;
address r;
for (i = 0; i < receiveLength; i ++) {
r = receivers[i];
if (r == address(0) || r == owner) continue;
receiverCount ++;
totalAmount = totalAmount.add(amounts[i]);
}
require(totalAmount > 0);
require(canPay(from, totalAmount));
uint256 warrant;
if (msg.sender != from) {
warrant = warrants[from][msg.sender];
require(totalAmount <= warrant);
warrants[from][msg.sender] = warrant.sub(totalAmount);
}
wallets[from] = wallets[from].sub(totalAmount);
uint256 amount;
for (i = 0; i < receiveLength; i++) {
r = receivers[i];
if (r == address(0) || r == owner) continue;
amount = amounts[i];
if (amount == 0) continue;
wallets[r] = wallets[r].add(amount);
emit Transfer(from, r, amount);
}
return true;
}
punch keyboard_arrow_up
Modifiers help
Requirements help
Source Code
function punch (address addr, uint256 amount) public onlyOwner whenPaused returns (bool) {
require(addr != address(0) && addr != owner);
require(amount > 0);
uint256 accountAmount = availableWallet(addr);
uint256 burnAmount = amount;
if (amount > accountAmount) {
burnAmount = accountAmount;
}
token_created = token_created.sub(burnAmount);
wallets[addr] = wallets[addr].sub(burnAmount);
emit Burn(addr, burnAmount);
emit Transfer(addr, address(0), burnAmount);
return true;
}
batchPunchKO keyboard_arrow_up
Modifiers help
Source Code
function batchPunchKO (address[] addrs) public onlyOwner whenPaused returns (bool) {
uint len = addrs.length;
require (len > 0);
address addr;
for (uint i = 0; i < len; i++) {
addr = addrs[i];
if (addr == address(0) || addr == owner) continue;
uint256 amount = availableWallet(addr);
token_created = token_created.sub(amount);
wallets[addr] = wallets[addr].sub(amount);
emit Burn(addr, amount);
emit Transfer(addr, address(0), amount);
}
return true;
}
batchPunchs keyboard_arrow_up
Modifiers help
Requirements help
Source Code
function batchPunchs (address[] addrs, uint256[] amounts) public onlyOwner whenPaused returns (bool) {
uint len = addrs.length;
require (len > 0);
require (addrs.length == amounts.length);
address addr;
uint256 amount;
uint256 availableAmount;
for (uint i = 0; i < len; i++) {
addr = addrs[i];
if (addr == address(0) || addr == owner) continue;
amount = amounts[i];
availableAmount = availableWallet(addr);
if (amount > availableAmount) {
amount = availableAmount;
}
token_created = token_created.sub(amount);
wallets[addr] = wallets[addr].sub(amount);
emit Burn(addr, amount);
emit Transfer(addr, address(0), amount);
}
return true;
}
suicide keyboard_arrow_up
finishUpgrade keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
whenNotUpgrading checks for the following:
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function finishUpgrade() public whenNotUpgrading canUpgrade onlyOwner{
upgrade_finish = true;
emit FinishUpgrade();
}
setFoundation keyboard_arrow_up
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
whenPaused checks for the following:
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function setFoundation(uint amount) public whenUpgrading whenPaused canUpgrade onlyOwner {
token_foundation_created = amount;
emit SetFoundation(amount);
}
setRefund keyboard_arrow_up
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
canUpgrade checks for the following:
onlyOwner checks for the following:
Requirements help
Source Code
function setRefund(address addr, uint amount) public whenUpgrading canUpgrade onlyOwner {
require(addr != address(0));
require(addr != foundationOwner);
require(addr != owner);
refundlist[addr] = amount;
emit SetRefund(addr, amount);
}
batchSetRefund keyboard_arrow_up
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function batchSetRefund(address[] addrs, uint[] amounts) public whenUpgrading canUpgrade onlyOwner {
uint l1 = addrs.length;
uint l2 = amounts.length;
address addr;
uint amount;
require(l1 > 0 && l1 == l2);
for (uint i = 0; i < l1; i++){
addr = addrs[i];
amount = amounts[i];
if (addr == address(0) || addr == foundationOwner || addr == owner) continue;
refundlist[addr] = amount;
emit SetRefund(addr, amount);
}
}
runRefund keyboard_arrow_up
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function runRefund(address addr) public whenUpgrading canUpgrade onlyOwner {
uint amount = refundlist[addr];
wallets[addr] = wallets[addr].add(amount);
token_created = token_created.add(amount);
refundlist[addr] = 0;
emit Refund(addr, amount);
emit Mint(addr, amount);
emit Transfer(address(0), addr, amount);
}
batchRunRefund keyboard_arrow_up
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function batchRunRefund(address[] addrs) public whenUpgrading canUpgrade onlyOwner {
uint l = addrs.length;
address addr;
uint amount;
require(l > 0);
for (uint i = 0; i < l; i++){
addr = addrs[i];
amount = refundlist[addr];
wallets[addr] = wallets[addr].add(amount);
token_created = token_created.add(amount);
refundlist[addr] = 0;
emit Refund(addr, amount);
emit Mint(addr, amount);
emit Transfer(address(0), addr, amount);
}
}
startUpgrade keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
whenNotUpgrading checks for the following:
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function startUpgrade() public whenNotUpgrading canUpgrade onlyOwner {
upgrade_running = true;
emit UpgradeStart();
}
stopUpgrade keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function stopUpgrade() public whenUpgrading canUpgrade onlyOwner {
upgrade_running = false;
emit UpgradeStop();
}
setSkiplist keyboard_arrow_up
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
whenPaused checks for the following:
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function setSkiplist(address[] addrs) public whenUpgrading whenPaused canUpgrade onlyOwner {
uint len = addrs.length;
if (len>0){
for (uint i = 0; i < len; i++){
skiplist[addrs[i]] = true;
}
}
}
upgrade keyboard_arrow_up
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
whenPaused checks for the following:
canUpgrade checks for the following:
onlyOwner checks for the following:
Requirements help
Source Code
function upgrade(address addr) whenUpgrading whenPaused canUpgrade onlyOwner{
uint amount = ftn.balanceOf(addr);
require(!upgraded[addr] && amount>0 && !skiplist[addr]);
upgraded[addr] = true;
wallets[addr] = amount;
(uint a, uint b, uint c, uint d) = ftn.lockbins(addr,0);
uint len = d;
if (len > 0){
lockbins[addr][0].amount = len;
for (uint i=1; i <= len; i++){
(a, b, c, d) = ftn.lockbins(addr,i);
lockbins[addr][i] = LockBin({
start: a,
finish: b,
duration: c,
amount: d
});
}
}
token_created = token_created.add(amount);
emit Mint(addr, amount);
emit Transfer(address(0), addr, amount);
}
batchUpgrade keyboard_arrow_up
Modifiers help
whenUpgrading checks for the following:
upgrade_running must be true
whenPaused checks for the following:
canUpgrade checks for the following:
onlyOwner checks for the following:
Source Code
function batchUpgrade(address[] addrs) whenUpgrading whenPaused canUpgrade onlyOwner{
uint l = addrs.length;
require(l > 0);
uint a;
uint b;
uint c;
uint d;
for (uint i = 0; i < l; i++){
address addr = addrs[i];
uint amount = ftn.balanceOf(addr);
if (upgraded[addr] || amount == 0 || skiplist[addr]){
continue;
}
upgraded[addr] = true;
wallets[addr] = amount;
(a, b, c, d) = ftn.lockbins(addr,0);
uint len = d;
if (len > 0){
lockbins[addr][0].amount = len;
for (uint j=1; j <= len; j++){
(a, b, c, d) = ftn.lockbins(addr, j);
lockbins[addr][j] = LockBin({
start: a,
finish: b,
duration: c,
amount: d
});
}
}
token_created = token_created.add(amount);
emit Mint(addr, amount);
emit Transfer(address(0), addr, amount);
}
}