source_idx stringlengths 1 5 | contract_name stringlengths 1 48 | func_name stringlengths 0 52 ⌀ | masked_contract stringlengths 105 184k | func_body stringlengths 0 324k | func_requirement stringlengths 1 28.3k |
|---|---|---|---|---|---|
85397 | BasicToken | balanceOf | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) pub... |
return balances[_owner];
| *
* @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. |
85397 | StandardToken | transferFrom | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @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 transf... |
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_fr... | *
* @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 |
85397 | StandardToken | approve | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @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 transf... |
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _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 thi... |
85397 | StandardToken | allowance | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @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 transf... |
return allowed[_owner][_spender];
| *
* @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. |
85397 | StandardToken | increaseApproval | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @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 transf... |
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
| *
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol |
85397 | Ownable | Ownable | 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 {<FILL_FUNCTION_BODY>}
/... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. |
85397 | Ownable | transferOwnership | 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;
}... |
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
85397 | Pausable | pause | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... |
paused = true;
Pause();
| *
* @dev called by the owner to pause, triggers stopped state |
85397 | Pausable | unpause | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... |
paused = false;
Unpause();
| *
* @dev called by the owner to unpause, returns to normal state |
85397 | MintableToken | finishMinting | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
event SaleAgentUpdated(address currentSaleAgent);
bool public mintingFinished = false;
address public saleAgent;
modifier notLocked() {
require(msg.sender == ... |
require((msg.sender == saleAgent || msg.sender == owner) && !mintingFinished);
mintingFinished = true;
MintFinished();
return true;
| *
* @dev Function to stop minting new tokens.
* @return True if the operation was successful. |
85397 | StagedCrowdsale | stagesCount | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
return stages.length;
| *
* counts current sale's stages |
85397 | StagedCrowdsale | setSoftcap | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
require(newSoftcap > 0);
softcap = newSoftcap.mul(1 ether);
| *
* sets softcap
* @param newSoftcap new softcap |
85397 | StagedCrowdsale | setStart | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
start = newStart;
| *
* sets start date
* @param newStart new softcap |
85397 | StagedCrowdsale | setPeriod | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
period = newPeriod;
| *
* sets period of sale
* @param newPeriod new period of sale |
85397 | StagedCrowdsale | addStage | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
require(hardcap > 0 && price > 0);
Stage memory stage = Stage(hardcap.mul(1 ether), price, 0, 0);
stages.push(stage);
totalHardcap = totalHardcap.add(stage.hardcap);
MilestoneAdded(hardcap, price);
| *
* adds stage to sale
* @param hardcap stage's hardcap in ethers
* @param price stage's price |
85397 | StagedCrowdsale | removeStage | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
require(number >= 0 && number < stages.length);
Stage storage stage = stages[number];
totalHardcap = totalHardcap.sub(stage.hardcap);
delete stages[number];
for (uint i = number; i < stages.length - 1; i++) {
stages[i] = stages[i+1];
}
stages.length--;
| *
* removes stage from sale
* @param number index of item to delete |
85397 | StagedCrowdsale | changeStage | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
require(number >= 0 && number < stages.length);
Stage storage stage = stages[number];
totalHardcap = totalHardcap.sub(stage.hardcap);
stage.hardcap = hardcap.mul(1 ether);
stage.price = price;
totalHardcap = totalHardcap.add(stage.hardcap);
| *
* updates stage
* @param number index of item to update
* @param hardcap stage's hardcap in ethers
* @param price stage's price |
85397 | StagedCrowdsale | insertStage | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
require(numberAfter < stages.length);
Stage memory stage = Stage(hardcap.mul(1 ether), price, 0, 0);
totalHardcap = totalHardcap.add(stage.hardcap);
stages.length++;
for (uint i = stages.length - 2; i > numberAfter; i--) {
stages[i + 1] = stages[i];
}
stages[numberAfter + 1] =... | *
* inserts stage
* @param numberAfter index to insert
* @param hardcap stage's hardcap in ethers
* @param price stage's price |
85397 | StagedCrowdsale | clearStages | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
for (uint i = 0; i < stages.length; i++) {
delete stages[i];
}
stages.length -= stages.length;
totalHardcap = 0;
| *
* deletes all stages |
85397 | StagedCrowdsale | lastSaleDate | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
return start + period * 1 days;
| *
* calculates last sale date |
85397 | StagedCrowdsale | currentStage | contract StagedCrowdsale is Pausable {
using SafeMath for uint;
//Structure of stage information
struct Stage {
uint hardcap;
uint price;
uint invested;
uint closed;
}
//start date of sale
uint public start;
//period in days of sale
uint public period;
//sale's ... |
for(uint i = 0; i < stages.length; i++) {
if(stages[i].closed == 0) {
return i;
}
}
revert();
| *
* returns index of current stage |
85397 | CommonSale | setToken | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
token = MYTCToken(newToken);
| *
* sets MYTC token
* @param newToken new token |
85397 | CommonSale | setMinInvestment | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
minInvestment = newMinInvestment;
| *
* sets minimum investement threshold
* @param newMinInvestment new minimum investement threshold |
85397 | CommonSale | setMasterWallet | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
masterWallet = newMasterWallet;
| *
* sets master wallet address
* @param newMasterWallet new master wallet address |
85397 | CommonSale | setSlaveWallet | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
require(!slaveWalletInitialized);
slaveWallet = newSlaveWallet;
slaveWalletInitialized = true;
| *
* sets slave wallet address
* @param newSlaveWallet new slave wallet address |
85397 | CommonSale | setSlaveWalletPercent | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
require(!slaveWalletPercentInitialized);
slaveWalletPercent = newSlaveWalletPercent;
slaveWalletPercentInitialized = true;
| *
* sets slave wallet percentage
* @param newSlaveWalletPercent new wallet percentage |
85397 | CommonSale | setDirectMintAgent | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
directMintAgent = newDirectMintAgent;
| *
* sets direct mint agent
* @param newDirectMintAgent new agent |
85397 | CommonSale | directMint | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
calculateAndMintTokens(to, investedWei);
TokenPurchased(to, investedWei, now);
| *
* mints directly from network
* @param to invesyor's adress to transfer the minted tokens to
* @param investedWei number of wei invested |
85397 | CommonSale | createTokens | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
require(msg.value >= minInvestment);
uint masterValue = msg.value.mul(percentRate.sub(slaveWalletPercent)).div(percentRate);
uint slaveValue = msg.value.sub(masterValue);
masterWallet.transfer(masterValue);
slaveWallet.transfer(slaveValue);
calculateAndMintTokens(msg.sender, msg.value);
... | *
* splits investment into master and slave wallets for security reasons |
85397 | CommonSale | calculateAndMintTokens | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
//calculate number of tokens
uint stageIndex = currentStage();
Stage storage stage = stages[stageIndex];
uint tokens = weiInvested.mul(stage.price);
//if we have a new contributor
if(investedAmountOf[msg.sender] == 0) {
contributors[uniqueContributors] = msg.sender;
uniq... | *
* Calculates and records contributions
* @param to invesyor's adress to transfer the minted tokens to
* @param weiInvested number of wei invested |
85397 | CommonSale | mintTokens | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
token.mint(this, tokens);
token.transfer(to, tokens);
TokenMinted(to, tokens, now);
| *
* Mint tokens
* @param to adress destination to transfer the tokens to
* @param tokens number of tokens to mint and transfer |
85397 | CommonSale | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
createTokens();
| *
* Payable function | |
85397 | CommonSale | retrieveExternalTokens | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
ERC20 alienToken = ERC20(anotherToken);
alienToken.transfer(to, alienToken.balanceOf(this));
| *
* Function to retrieve and transfer back external tokens
* @param anotherToken external token received
* @param to address destination to transfer the token to |
85397 | CommonSale | refund | contract CommonSale is StagedCrowdsale {
//Our MYTC token
MYTCToken public token;
//slave wallet percentage
uint public slaveWalletPercent = 50;
//total percent rate
uint public percentRate = 100;
//min investment value in wei
uint public minInvestment;
//bool to check if wallet... |
uint value = investedAmountOf[msg.sender];
investedAmountOf[msg.sender] = 0;
msg.sender.transfer(value);
InvestmentReturned(msg.sender, value, now);
| *
* Function to refund funds if softcap is not reached and sale period is over |
85397 | MYTCToken | transfer | contract MYTCToken is MintableToken {
//Token name
string public constant name = "MYTC";
//Token symbol
string public constant symbol = "MYTC";
//Token's number of decimals
uint32 public constant decimals = 18;
//Dictionary with locked accounts
mapping (address => uint) publi... |
require(locked[msg.sender] < now);
return super.transfer(_to, _value);
| *
* transfer for unlocked accounts |
85397 | MYTCToken | transferFrom | contract MYTCToken is MintableToken {
//Token name
string public constant name = "MYTC";
//Token symbol
string public constant symbol = "MYTC";
//Token's number of decimals
uint32 public constant decimals = 18;
//Dictionary with locked accounts
mapping (address => uint) publi... |
require(locked[_from] < now);
return super.transferFrom(_from, _to, _value);
| *
* transfer from for unlocked accounts |
85397 | MYTCToken | lock | contract MYTCToken is MintableToken {
//Token name
string public constant name = "MYTC";
//Token symbol
string public constant symbol = "MYTC";
//Token's number of decimals
uint32 public constant decimals = 18;
//Dictionary with locked accounts
mapping (address => uint) publi... |
require(locked[addr] < now && (msg.sender == saleAgent || msg.sender == addr));
locked[addr] = now + periodInDays * 1 days;
| *
* locks an account for given a number of days
* @param addr account address to be locked
* @param periodInDays days to be locked |
85397 | PreTge | setMainsale | contract PreTge is CommonSale {
//TGE
Tge public tge;
/**
* event for PreTGE finalization logging
* @param finalizer account who trigger finalization
* @param saleEnded time of log
*/
event PreTgeFinalized(address indexed finalizer, uint256 saleEnded);
/**
* sets T... |
tge = Tge(newMainsale);
| *
* sets TGE to pass agent when sale is finished
* @param newMainsale adress of TGE contract |
85397 | PreTge | setTgeAsSaleAgent | contract PreTge is CommonSale {
//TGE
Tge public tge;
/**
* event for PreTGE finalization logging
* @param finalizer account who trigger finalization
* @param saleEnded time of log
*/
event PreTgeFinalized(address indexed finalizer, uint256 saleEnded);
/**
* sets T... |
token.setSaleAgent(tge);
PreTgeFinalized(msg.sender, now);
| *
* sets TGE as new sale agent when sale is finished |
85397 | Tge | setLockPeriod | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
lockPeriod = newLockPeriod;
| *
* sets lock period in days for team's wallet
* @param newLockPeriod new lock period in days |
85397 | Tge | setTeamTokensPercent | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
teamTokensPercent = newTeamTokensPercent;
| *
* sets percentage for team's wallet
* @param newTeamTokensPercent new percentage for team's wallet |
85397 | Tge | setBountyTokensPercent | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
bountyTokensPercent = newBountyTokensPercent;
| *
* sets percentage for bounty's wallet
* @param newBountyTokensPercent new percentage for bounty's wallet |
85397 | Tge | setReservedTokensPercent | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
reservedTokensPercent = newReservedTokensPercent;
| *
* sets percentage for reserved wallet
* @param newReservedTokensPercent new percentage for reserved wallet |
85397 | Tge | setTotalTokenSupply | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
totalTokenSupply = newTotalTokenSupply;
| *
* sets max number of tokens to ever mint
* @param newTotalTokenSupply max number of tokens (incl. 18 dec points) |
85397 | Tge | setTeamTokensWallet | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
teamTokensWallet = newTeamTokensWallet;
| *
* sets address for team's wallet
* @param newTeamTokensWallet new address for team's wallet |
85397 | Tge | setBountyTokensWallet | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
bountyTokensWallet = newBountyTokensWallet;
| *
* sets address for bountys's wallet
* @param newBountyTokensWallet new address for bountys's wallet |
85397 | Tge | setReservedTokensWallet | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
reservedTokensWallet = newReservedTokensWallet;
| *
* sets address for reserved wallet
* @param newReservedTokensWallet new address for reserved wallet |
85397 | Tge | endSale | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
// uint remainingPercentage = bountyTokensPercent.add(teamTokensPercent).add(reservedTokensPercent);
// uint tokensGenerated = token.totalSupply();
uint foundersTokens = totalTokenSupply.mul(teamTokensPercent).div(percentRate);
uint reservedTokens = totalTokenSupply.mul(reservedTokensPercent)... | *
* Mints remaining tokens and finishes minting when sale is successful
* No further tokens will be minted ever |
85397 | Tge | contract Tge is WhiteListToken {
//Team wallet address
address public teamTokensWallet;
//Bounty and advisors wallet address
address public bountyTokensWallet;
//Reserved tokens wallet address
address public reservedTokensWallet;
//Team percentage
uint public teamTokensPercent;
... |
require(now >= start && now < lastSaleDate());
createTokens();
| *
* Payable function | |
85398 | ERC20 | totalSupply | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
return _totalSupply;
| *
* @dev Total number of tokens in existence |
85398 | ERC20 | balanceOf | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
return _balances[owner];
| *
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return A uint256 representing the amount owned by the passed address. |
85398 | ERC20 | allowance | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
return _allowed[owner][spender];
| *
* @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. |
85398 | ERC20 | transfer | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
_transfer(msg.sender, to, value);
return true;
| *
* @dev Transfer token to a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred. |
85398 | ERC20 | approve | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
_approve(msg.sender, spender, 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 thi... |
85398 | ERC20 | transferFrom | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
_transfer(from, to, value);
_approve(from, msg.sender, _allowed[from][msg.sender].sub(value));
return true;
| *
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
*... |
85398 | ERC20 | increaseAllowance | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
_approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue));
return true;
| *
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO T... |
85398 | ERC20 | decreaseAllowance | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
_approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue));
return true;
| *
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO T... |
85398 | ERC20 | _transfer | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
| *
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred. |
85398 | ERC20 | _mint | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
| *
* @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 account The account that will receive the created tokens.
* @param value The amount that will be c... |
85398 | ERC20 | _burn | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
| *
* @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. |
85398 | ERC20 | _approve | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
require(spender != address(0));
require(owner != address(0));
_allowed[owner][spender] = value;
emit Approval(owner, spender, value);
| *
* @dev Approve an address to spend another addresses' tokens.
* @param owner The address that owns the tokens.
* @param spender The address that will spend the tokens.
* @param value The number of tokens that can be spent. |
85398 | ERC20 | _burnFrom | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... |
_burn(account, value);
_approve(account, msg.sender, _allowed[account][msg.sender].sub(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 burn... |
85398 | ERC20Detailed | name | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @retu... |
return _name;
| *
* @return the name of the token. |
85398 | ERC20Detailed | symbol | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @retu... |
return _symbol;
| *
* @return the symbol of the token. |
85398 | ERC20Detailed | decimals | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @retu... |
return _decimals;
| *
* @return the number of decimals of the token. |
85399 | Tribe | null | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
minter = minter_;
emit MinterChanged(address(0), minter);
| *
* @notice Construct a new Tribe token
* @param account The initial account to grant all the tokens
* @param minter_ The account with minting ability |
85399 | Tribe | setMinter | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
require(msg.sender == minter, "Tribe: only the minter can change the minter address");
emit MinterChanged(minter, minter_);
minter = minter_;
| *
* @notice Change the minter address
* @param minter_ The address of the new minter |
85399 | Tribe | mint | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
require(msg.sender == minter, "Tribe: only the minter can mint");
require(dst != address(0), "Tribe: cannot transfer to the zero address");
// mint the amount
uint96 amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits");
uint96 safeSupply = safe96(totalSupply, "Tribe: tot... | *
* @notice Mint new tokens
* @param dst The address of the destination account
* @param rawAmount The number of tokens to be minted |
85399 | Tribe | allowance | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
return allowances[account][spender];
| *
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved |
85399 | Tribe | approve | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
... | *
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param... |
85399 | Tribe | permit | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits");
}
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)))... | *
* @notice Triggers an approval from owner to spends
* @param owner The address to approve from
* @param spender The address to be approved
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @param deadline The time at which to expire the signature
* @par... |
85399 | Tribe | balanceOf | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
return balances[account];
| *
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held |
85399 | Tribe | transfer | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
uint96 amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
| *
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded |
85399 | Tribe | transferFrom | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Tribe: transf... | *
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded |
85399 | Tribe | delegate | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
return _delegate(msg.sender, delegatee);
| *
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to |
85399 | Tribe | delegateBySig | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash))... | *
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r... |
85399 | Tribe | getCurrentVotes | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
| *
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account` |
85399 | Tribe | getPriorVotes | contract Tribe {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Tribe";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
/... |
require(blockNumber < block.number, "Tribe: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
... | *
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote ba... |
85403 | Queso | null | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
symbol = "Queso";
name = "QEO";
decimals = 8;
_totalSupply = 100000000000000;
balances[0xa7d03aAE6a7a64E9BC03d930B5DAA4142A7034Ed] = _totalSupply;
emit Transfer(address(0), 0xa7d03aAE6a7a64E9BC03d930B5DAA4142A7034Ed, _totalSupply);
| ------------------------------------------------------------------------
Constructor
------------------------------------------------------------------------ |
85403 | Queso | totalSupply | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
return _totalSupply - balances[address(0)];
| ------------------------------------------------------------------------
Total supply
------------------------------------------------------------------------ |
85403 | Queso | balanceOf | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
return balances[tokenOwner];
| ------------------------------------------------------------------------
Get the token balance for account tokenOwner
------------------------------------------------------------------------ |
85403 | Queso | transfer | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(msg.sender, to, tokens);
return true;
| ------------------------------------------------------------------------
Transfer the balance from token owner's account to to account
- Owner's account must have sufficient balance to transfer
- 0 value transfers are allowed
------------------------------------------------------------------------ |
85403 | Queso | approve | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
| https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
recommends that there are no checks for the approval double-spend attack
as this should be implemented in user interfaces
------------------------------------------------------------------------ |
85403 | Queso | transferFrom | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(from, to, tokens);
return true;
| The calling account must already have sufficient tokens approve(...)-d
for spending from the from account and
- From account must have sufficient balance to transfer
- Spender must have sufficient allowance to transfer
- 0 value transfers are allowed
---------------------------------------------------------------------... |
85403 | Queso | allowance | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
return allowed[tokenOwner][spender];
| ------------------------------------------------------------------------
Returns the amount of tokens approved by the owner that can be
transferred to the spender's account
------------------------------------------------------------------------ |
85403 | Queso | approveAndCall | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
| ------------------------------------------------------------------------
Token owner can approve for spender to transferFrom(...) tokens
from the token owner's account. The spender contract function
receiveApproval(...) is then executed
------------------------------------------------------------------------ |
85403 | Queso | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
revert();
| ------------------------------------------------------------------------
Don't accept ETH
------------------------------------------------------------------------ | |
85403 | Queso | transferAnyERC20Token | contract Queso is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -------------------------------------------... |
return ERC20Interface(tokenAddress).transfer(owner, tokens);
| ------------------------------------------------------------------------
Owner can transfer out any accidentally sent ERC20 tokens
------------------------------------------------------------------------ |
85414 | DragonDivs | null | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
owner = msg.sender;
whitelisted_[msg.sender] = true;
whitelist_ = true;
| =======================================
= PUBLIC FUNCTIONS =
=======================================
* -- APPLICATION ENTRY POINTS -- |
85414 | DragonDivs | buy | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
purchaseTokens(msg.value, _referredBy);
| *
* Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) |
85414 | DragonDivs | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
purchaseTokens(msg.value, 0x0);
| *
* Fallback function to handle ethereum that was send straight to the contract
* Unfortunately we cannot use a referral address this way. | |
85414 | DragonDivs | reinvest | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
// fetch dividends
uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code
// pay out the dividends virtually
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
// retrieve ref. b... | *
* Converts all of caller's dividends to tokens. |
85414 | DragonDivs | exit | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
// get token count for caller & sell them all
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if(_tokens > 0) sell(_tokens);
// lambo delivery service
withdraw();
| *
* Alias of sell() and withdraw(). |
85414 | DragonDivs | withdraw | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
// setup data
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false); // get ref. bonus later in the code
// update dividend tracker
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
// add ref. bonus
_dividend... | *
* Withdraws all of the callers earnings. |
85414 | DragonDivs | sell | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
// setup data
address _customerAddress = msg.sender;
// russian hackers BTFO
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _undividedDividends... | *
* Liquifies tokens to ethereum. |
85414 | DragonDivs | transfer | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
// setup
address _customerAddress = msg.sender;
// make sure we have the requested tokens
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
// withdraw all outstanding dividends first
if(myDividends(true) > 0) withdraw();
// exchange... | *
* Transfer tokens from the caller to a new holder.
* 0% fee. |
85414 | DragonDivs | redistribution | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
// setup
uint256 ethereum = msg.value;
// disperse ethereum among holders
profitPerShare_ = SafeMath.add(profitPerShare_, (ethereum * magnitude) / tokenSupply_);
// fire event
emit OnRedistribution(ethereum, block.timestamp);
| *
* redistribution of dividends |
85414 | DragonDivs | setAdministrator | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
owner = _newAdmin;
| *
* In case one of us dies, we need to replace ourselves. |
85414 | DragonDivs | setStakingRequirement | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
stakingRequirement = _amountOfTokens;
| *
* Precautionary measures in case we need to adjust the masternode rate. |
85414 | DragonDivs | setName | contract DragonDivs {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
// only people with profits
modifier onlyStro... |
name = _name;
| *
* If we want to rebrand, we can. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.