Rocket Pool
ERC20
This contract is an ERC20 token.
Name
Rocket Pool
Symbol
RPL
Decimals
18
Total Supply
18,000,000 RPL
About
link
Rocket Pool (RPL) is a cryptocurrency and operates on the Ethereum platform. Rocket Pool has a current supply of 17,922,514.606585 with 10,279,742.404181 in circulation. The last known price of Rocket Pool is 10.21416145 USD and is down -0.89 over the last 24 hours. It is currently trading on 12 active market(s) with $475,354.88 traded over the last 24 hours. More information can be found at https://www.rocketpool.net/.
Stats
Public Functions
25
Event Types
7
Code Size
22,304 bytes
Library Use
Uses SafeMath for uint.
Events (7) keyboard_arrow_up
Structs (1) keyboard_arrow_up
SalesAgent Struct
Members
saleContractAddress |
address help
|
saleContractType |
bytes32 help
|
targetEthMax |
uint256 help
|
targetEthMin |
uint256 help
|
tokensLimit |
uint256 help
|
tokensMinted |
uint256 help
|
minDeposit |
uint256 help
|
maxDeposit |
uint256 help
|
startBlock |
uint256 help
|
endBlock |
uint256 help
|
depositAddress |
address help
|
depositAddressCheckedIn |
bool help
|
finalised |
bool help
|
exists |
bool help
|
Constants (1) keyboard_arrow_up
State Variables (13) keyboard_arrow_up
Functions
transferOwnership keyboard_arrow_up
acceptOwnership keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Source Code
function transfer(address _to, uint256 _value) returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else {
return false;
}
}
transferFrom keyboard_arrow_up
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) returns (bool success) {
if (
balances[_from] >= _value &&
allowed[_from][msg.sender] >= _value &&
_value > 0
) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else {
return false;
}
}
approve keyboard_arrow_up
Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
allowance keyboard_arrow_up
validateContribution keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Requirements help
One or more of the following:
-
undefined.endBlock
must be equal to
0
- OR
block.number
must be less than
undefined.endBlock
Source Code
function validateContribution(uint256 _value)
isSalesContract(msg.sender)
returns (bool)
{
// Get an instance of the sale agent contract
SalesAgentInterface saleAgent = SalesAgentInterface(msg.sender);
// Did they send anything from a proper address?
assert(_value > 0);
// Check the depositAddress has been verified by the account holder
assert(salesAgents[msg.sender].depositAddressCheckedIn == true);
// Check if we're ok to receive contributions, have we started?
assert(block.number > salesAgents[msg.sender].startBlock);
// Already ended? Or if the end block is 0, it's an open ended sale until finalised by the depositAddress
assert(
block.number < salesAgents[msg.sender].endBlock ||
salesAgents[msg.sender].endBlock == 0
);
// Is it above the min deposit amount?
assert(_value >= salesAgents[msg.sender].minDeposit);
// Is it below the max deposit allowed?
assert(_value <= salesAgents[msg.sender].maxDeposit);
// No contributions if the sale contract has finalised
assert(salesAgents[msg.sender].finalised == false);
// Does this deposit put it over the max target ether for the sale contract?
assert(
saleAgent.contributedTotal().add(_value) <=
salesAgents[msg.sender].targetEthMax
);
// All good
return true;
}
validateClaimTokens keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Requirements help
UNKNOWN VALUE
must be greater than
0
Source Code
function validateClaimTokens(address _sender)
isSalesContract(msg.sender)
returns (bool)
{
// Get an instance of the sale agent contract
SalesAgentInterface saleAgent = SalesAgentInterface(msg.sender);
// Must have previously contributed
assert(saleAgent.getContributionOf(_sender) > 0);
// Sale contract completed
assert(block.number > salesAgents[msg.sender].endBlock);
// All good
return true;
}
mint keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Requirements help
Source Code
function mint(address _to, uint256 _amount)
isSalesContract(msg.sender)
returns (bool)
{
// Check if we're ok to mint new tokens, have we started?
// We dont check for the end block as some sale agents mint tokens during the sale, and some after its finished (proportional sales)
assert(block.number > salesAgents[msg.sender].startBlock);
// Check the depositAddress has been verified by the designated account holder that will receive the funds from that agent
assert(salesAgents[msg.sender].depositAddressCheckedIn == true);
// No minting if the sale contract has finalised
assert(salesAgents[msg.sender].finalised == false);
// Check we don't exceed the assigned tokens of the sale agent
assert(
salesAgents[msg.sender].tokensLimit >=
salesAgents[msg.sender].tokensMinted.add(_amount)
);
// Verify ok balances and values
assert(_amount > 0);
// Check we don't exceed the supply limit
assert(totalSupply.add(_amount) <= totalSupplyCap);
// Ok all good, automatically checks for overflow with safeMath
balances[_to] = balances[_to].add(_amount);
// Add to the total minted for that agent, automatically checks for overflow with safeMath
salesAgents[msg.sender].tokensMinted = salesAgents[msg.sender]
.tokensMinted
.add(_amount);
// Add to the overall total minted, automatically checks for overflow with safeMath
totalSupply = totalSupply.add(_amount);
// Fire the event
MintToken(msg.sender, _to, _amount);
// Fire the transfer event
Transfer(0x0, _to, _amount);
// Completed
return true;
}
getRemainingTokens keyboard_arrow_up
setSaleAgentContract keyboard_arrow_up
Parameters help
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function setSaleAgentContract(
address _saleAddress,
string _saleContractType,
uint256 _targetEthMin,
uint256 _targetEthMax,
uint256 _tokensLimit,
uint256 _minDeposit,
uint256 _maxDeposit,
uint256 _startBlock,
uint256 _endBlock,
address _depositAddress
)
public
// Only the owner can register a new sale agent
onlyOwner
{
// Valid addresses?
assert(_saleAddress != 0x0 && _depositAddress != 0x0);
// Must have some available tokens
assert(_tokensLimit > 0 && _tokensLimit <= totalSupplyCap);
// Make sure the min deposit is less than or equal to the max
assert(_minDeposit <= _maxDeposit);
// Add the new sales contract
salesAgents[_saleAddress] = SalesAgent({
saleContractAddress: _saleAddress,
saleContractType: sha3(_saleContractType),
targetEthMin: _targetEthMin,
targetEthMax: _targetEthMax,
tokensLimit: _tokensLimit,
tokensMinted: 0,
minDeposit: _minDeposit,
maxDeposit: _maxDeposit,
startBlock: _startBlock,
endBlock: _endBlock,
depositAddress: _depositAddress,
depositAddressCheckedIn: false,
finalised: false,
exists: true
});
// Store our agent address so we can iterate over it if needed
salesAgentsAddresses.push(_saleAddress);
}
setSaleContractFinalised keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Requirements help
Source Code
function setSaleContractFinalised(address _sender)
public
isSalesContract(msg.sender)
returns (bool)
{
// Get an instance of the sale agent contract
SalesAgentInterface saleAgent = SalesAgentInterface(msg.sender);
// Finalise the crowdsale funds
assert(!salesAgents[msg.sender].finalised);
// The address that will receive this contracts deposit, should match the original senders
assert(salesAgents[msg.sender].depositAddress == _sender);
// If the end block is 0, it means an open ended crowdsale, once it's finalised, the end block is set to the current one
if (salesAgents[msg.sender].endBlock == 0) {
salesAgents[msg.sender].endBlock = block.number;
}
// Not yet finished?
assert(block.number >= salesAgents[msg.sender].endBlock);
// Not enough raised?
assert(saleAgent.contributedTotal() >= salesAgents[msg.sender].targetEthMin);
// We're done now
salesAgents[msg.sender].finalised = true;
// Fire the event
SaleFinalised(msg.sender, _sender, salesAgents[msg.sender].tokensMinted);
// All good
return true;
}
setSaleContractDepositAddressVerified keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Requirements help
Source Code
function setSaleContractDepositAddressVerified(address _verifyAddress)
public
isSalesContract(msg.sender)
{
// Check its verified
assert(
salesAgents[msg.sender].depositAddress == _verifyAddress &&
_verifyAddress != 0x0
);
// Ok set it now
salesAgents[msg.sender].depositAddressCheckedIn = true;
}
getSaleContractIsFinalised keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractIsFinalised(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (bool)
{
return salesAgents[_salesAgentAddress].finalised;
}
getSaleContractTargetEtherMin keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractTargetEtherMin(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (uint256)
{
return salesAgents[_salesAgentAddress].targetEthMin;
}
getSaleContractTargetEtherMax keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractTargetEtherMax(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (uint256)
{
return salesAgents[_salesAgentAddress].targetEthMax;
}
getSaleContractDepositEtherMin keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractDepositEtherMin(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (uint256)
{
return salesAgents[_salesAgentAddress].minDeposit;
}
getSaleContractDepositEtherMax keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractDepositEtherMax(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (uint256)
{
return salesAgents[_salesAgentAddress].maxDeposit;
}
getSaleContractDepositAddress keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractDepositAddress(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (address)
{
return salesAgents[_salesAgentAddress].depositAddress;
}
getSaleContractDepositAddressVerified keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractDepositAddressVerified(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (bool)
{
return salesAgents[_salesAgentAddress].depositAddressCheckedIn;
}
getSaleContractStartBlock keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractStartBlock(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (uint256)
{
return salesAgents[_salesAgentAddress].startBlock;
}
getSaleContractEndBlock keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractEndBlock(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (uint256)
{
return salesAgents[_salesAgentAddress].endBlock;
}
getSaleContractTokensLimit keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractTokensLimit(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (uint256)
{
return salesAgents[_salesAgentAddress].tokensLimit;
}
getSaleContractTokensMinted keyboard_arrow_up
Modifiers help
isSalesContract checks for the following:
Source Code
function getSaleContractTokensMinted(address _salesAgentAddress)
public
constant
isSalesContract(_salesAgentAddress)
returns (uint256)
{
return salesAgents[_salesAgentAddress].tokensMinted;
}
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.