Blockwell

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

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

FlagAddress Event

Parameters help
flag
address help

FlagUint Event

Parameters help
flag
uint256 help

MintToken Event

Parameters help
_agent
address help
_address
address help
_value
uint256 help

OwnershipTransferred Event

Parameters help
_from
address help
_to
address help

SaleFinalised Event

Parameters help
_agent
address help
_address
address help
_value
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

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

decimals Constant

uint8 help
18

name Variable

string help

symbol Variable

string help

version Variable

string help

exponent Variable

uint256 help

totalSupply Variable

uint256 help

totalSupplyCap Variable

uint256 help

totalSupply Variable

uint256 help

owner Variable

address help

newOwner Variable

address help

salesAgents Variable

mapping(address => SalesAgent) help
Internal Variable

salesAgentsAddresses Variable

address[] help
Internal Variable

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

Functions Expand All Collapse All

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferOwnership(address _newOwner) onlyOwner {
  newOwner = _newOwner;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function acceptOwnership() {
  require(msg.sender == newOwner);
  OwnershipTransferred(owner, newOwner);
  owner = newOwner;
}

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
function balanceOf(address _owner) constant returns (uint256 balance) {
  return balances[_owner];
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
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;
  }
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
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;
  }
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
  allowed[msg.sender][_spender] = _value;
  Approval(msg.sender, _spender, _value);
  return true;
}

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
function allowance(address _owner, address _spender)
  constant
  returns (uint256 remaining)
{
  return allowed[_owner][_spender];
}

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

isSalesContract checks for the following:

Requirements help

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;
}

Parameters help

Name Type
_sender
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

isSalesContract checks for the following:

Requirements help

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;
}

Parameters help

Name Type
_to
address help
_amount
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

isSalesContract checks for the following:
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;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function getRemainingTokens() public constant returns (uint256) {
  return totalSupplyCap.sub(totalSupply);
}

Parameters help

Name Type
_saleAddress
address help
_saleContractType
string help
_targetEthMin
uint256 help
_targetEthMax
uint256 help
_tokensLimit
uint256 help
_minDeposit
uint256 help
_maxDeposit
uint256 help
_startBlock
uint256 help
_endBlock
uint256 help
_depositAddress
address help

Properties

Visibility help public
Mutability help transaction
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);
}

Parameters help

Name Type
_sender
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

isSalesContract checks for the following:
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;
}

Parameters help

Name Type
_verifyAddress
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

isSalesContract checks for the following:
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;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractIsFinalised(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (bool)
{
  return salesAgents[_salesAgentAddress].finalised;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractTargetEtherMin(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (uint256)
{
  return salesAgents[_salesAgentAddress].targetEthMin;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractTargetEtherMax(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (uint256)
{
  return salesAgents[_salesAgentAddress].targetEthMax;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractDepositEtherMin(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (uint256)
{
  return salesAgents[_salesAgentAddress].minDeposit;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractDepositEtherMax(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (uint256)
{
  return salesAgents[_salesAgentAddress].maxDeposit;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractDepositAddress(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (address)
{
  return salesAgents[_salesAgentAddress].depositAddress;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractDepositAddressVerified(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (bool)
{
  return salesAgents[_salesAgentAddress].depositAddressCheckedIn;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractStartBlock(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (uint256)
{
  return salesAgents[_salesAgentAddress].startBlock;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractEndBlock(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (uint256)
{
  return salesAgents[_salesAgentAddress].endBlock;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

Modifiers help

isSalesContract checks for the following:
Source Code
function getSaleContractTokensLimit(address _salesAgentAddress)
  public
  constant
  isSalesContract(_salesAgentAddress)
  returns (uint256)
{
  return salesAgents[_salesAgentAddress].tokensLimit;
}

Parameters help

Name Type
_salesAgentAddress
address help

Properties

Visibility help public
Mutability help constant

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 Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.