Added "non-pool-based" miner type and updated business rules. Added referral for miners. Added "referral" pool type and updated business rules. Updated tests and playground.

This commit is contained in:
pmmax committed 2018-12-16 23:11:58 -03:00
1 parent 69b389ddc4
commit 58a5a356ea
32 files changed
+18945 -15467

No files matched your search

@@ -32,10 +32,10 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution
protected override string AbiResourceName => $"SmartContracts.src.bin.{nameof(AlgoMiner)}.abi";
protected override string BinResourceName => $"SmartContracts.src.bin.{nameof(AlgoMiner)}.bin";
protected override BigInteger DeploymentGasUnits => 1400000;
protected override BigInteger DeploymentGasUnits => 1600000;
public Task<TransactionReceipt> DeployAsync(ushort minerType, byte category, string minerAccountAddress, string tokenAddress)
=> base.DeployAsync(minerType, category, minerAccountAddress, tokenAddress);
public Task<TransactionReceipt> DeployAsync(byte minerType, byte category, string minerAccountAddress, string referralAccountAddress, string tokenAddress)
=> base.DeployAsync(minerType, category, minerAccountAddress, referralAccountAddress, tokenAddress);
protected override void Initialize(Contract contractDescriptor)
{
@@ -73,8 +73,8 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution
public Task<TransactionReceipt> StopAndRemoveOwnershipAsync() =>
InvokeAsync(_stopAndRemoveOwnership, 900000);
public Task<TransactionReceipt> ResetMinerAsync(string newOwnerAddress) =>
InvokeAsync(_resetMiner, 900000, newOwnerAddress);
public Task<TransactionReceipt> ResetMinerAsync(string newOwnerAddress, string newReferralAddress) =>
InvokeAsync(_resetMiner, 900000, newOwnerAddress, newReferralAddress);
public Task<TransactionReceipt> StartMiningAsync() =>
InvokeAsync(_startMining, 900000);
@@ -21,7 +21,7 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution
protected override string BinResourceName => $"SmartContracts.src.bin.{nameof(AlgoPool)}.bin";
protected override BigInteger DeploymentGasUnits => 1200000;
public Task<TransactionReceipt> DeployAsync(ushort poolType, string tokenAddress)
public Task<TransactionReceipt> DeployAsync(byte poolType, string tokenAddress)
=> base.DeployAsync(poolType, tokenAddress);
protected override void Initialize(Contract contractDescriptor)
@@ -0,0 +1,28 @@
pragma solidity 0.4.24;
contract AlgoCommon {
uint256 internal constant TOKEN_FACTOR = 10 ** uint256(18);
uint256 internal constant CAT_0_VALUE = 100000 * TOKEN_FACTOR;
uint256 internal constant CAT_1_VALUE = 1000000 * TOKEN_FACTOR;
uint256 internal constant CAT_2_VALUE = 2 * 1000000 * TOKEN_FACTOR;
uint256 internal constant CAT_3_VALUE = 3 * 1000000 * TOKEN_FACTOR;
uint256 internal constant CAT_4_VALUE = 4 * 1000000 * TOKEN_FACTOR;
uint256 internal constant CAT_5_VALUE = 5 * 1000000 * TOKEN_FACTOR;
function getCapacityByCategory(uint8 category) internal pure returns (uint256) {
if(category == 0) {
return CAT_0_VALUE;
} else if(category == 1) {
return CAT_1_VALUE;
} else if(category == 2) {
return CAT_2_VALUE;
} else if(category == 3) {
return CAT_3_VALUE;
} else if(category == 4) {
return CAT_4_VALUE;
} else if(category == 5) {
return CAT_5_VALUE;
}
}
}
@@ -4,16 +4,22 @@ import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "./IAlgoMiner.sol";
import "./AlgoCommon.sol";
import "./ERC20TokenHolder.sol";
import "./AlgoSystemRole.sol";
import "./AlgoCoreTeamRole.sol";
import "./AlgoSupervisorRole.sol";
contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlgoMiner {
contract AlgoMiner is AlgoCommon, ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlgoMiner {
using SafeERC20 for IERC20;
uint256 public constant DAYS_PER_YEAR = 365;
enum MinerType {
PoolBased,
NonPoolBased
}
enum MinerState {
Deactivated,
Activated,
@@ -21,9 +27,10 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
Stopped
}
uint16 private _minerType;
MinerType private _minerType;
uint8 private _category;
address private _miner;
address private _referral;
MinerState private _state;
bool private _mining;
@@ -31,7 +38,7 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
uint16 private _currentDay;
uint256 private _currentYearSupply;
constructor(uint16 minerType, uint8 category, address minerAccountAddress, address tokenAddress)
constructor(MinerType minerType, uint8 category, address minerAccountAddress, address referralAccountAddress, address tokenAddress)
ERC20TokenHolder(tokenAddress)
AlgoSystemRole()
AlgoCoreTeamRole()
@@ -43,6 +50,7 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
_minerType = minerType;
_category = category;
_miner = minerAccountAddress;
_referral = referralAccountAddress;
}
modifier onlyMiner() {
@@ -53,12 +61,16 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
function activateMiner() public notTerminated onlyCoreTeam {
require(_state == MinerState.Deactivated);
if(_currentYearSupply == 0) {
if(_minerType == MinerType.PoolBased && _currentYearSupply == 0) {
uint256 capacity = getCapacityByCategory(_category);
uint256 expectedBalance = capacity + capacity * 10 / 100;
uint256 currentBalance = _token.balanceOf(address(this));
require(currentBalance != 0);
require(currentBalance == expectedBalance);
_currentYearSupply = currentBalance / 2;
_currentYearSupply = capacity / 2;
}
_state = MinerState.Activated;
@@ -71,7 +83,6 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
_mining = false;
}
// TODO: Transfer the entire state to the new miner.
function migrateMiner(address newMinerAddress) public onlyCoreTeam {
require(_state == MinerState.Deactivated);
@@ -96,13 +107,15 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
_state = MinerState.Stopped;
_mining = false;
_miner = address(0);
_referral = address(0);
}
function resetMiner(address newOwnerAddress) public notTerminated onlySupervisor {
function resetMiner(address newOwnerAddress, address newReferralAddress) public notTerminated onlySupervisor {
require(_state == MinerState.Stopped);
_state = MinerState.Activated;
_miner = newOwnerAddress;
_referral = newReferralAddress;
}
function startMining() public notTerminated onlyMiner {
@@ -120,6 +133,7 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
}
function mine() public notTerminated onlySystem {
require(_minerType == MinerType.PoolBased);
require(_state == MinerState.Activated);
require(_mining);
@@ -135,11 +149,19 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
}
}
uint256 tokens = _currentYearSupply / DAYS_PER_YEAR;
uint256 minerTokens = _currentYearSupply / DAYS_PER_YEAR;
require(tokens > 0);
require(minerTokens > 0);
_token.safeTransfer(_miner, tokens);
_token.safeTransfer(_miner, minerTokens);
if(_referral != address(0)) {
uint256 referralTokens = minerTokens * 10 / 100;
require(referralTokens > 0);
_token.safeTransfer(_referral, referralTokens);
}
}
function terminate() public onlyCoreTeam {
@@ -150,15 +172,35 @@ contract AlgoMiner is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSu
return true;
}
function getMinerType() public view returns (uint8) {
return uint8(_minerType);
}
function getCategory() public view returns (uint8) {
return _category;
}
function getMiner() public view returns (address) {
return _miner;
}
function getReferral() public view returns (address) {
return _referral;
}
function isMining() public view returns (bool) {
return _state == MinerState.Activated && _mining;
}
function getMiner() public view returns (address) {
return _miner;
function getCurrentYear() public view returns (uint8) {
return _currentYear;
}
function getCurrentDay() public view returns (uint16) {
return _currentDay;
}
function getCurrentYearSupply() public view returns (uint256) {
return _currentYearSupply;
}
}
@@ -4,24 +4,22 @@ import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "./IAlgoMiner.sol";
import "./AlgoCommon.sol";
import "./ERC20TokenHolder.sol";
import "./AlgoCoreTeamRole.sol";
contract AlgoPool is ERC20TokenHolder, AlgoCoreTeamRole {
contract AlgoPool is AlgoCommon, ERC20TokenHolder, AlgoCoreTeamRole {
using SafeERC20 for IERC20;
uint256 public constant TOKEN_FACTOR = 10 ** uint256(18);
uint256 public constant CAT_0_VALUE = 100000 * TOKEN_FACTOR;
uint256 public constant CAT_1_VALUE = 1000000 * TOKEN_FACTOR;
uint256 public constant CAT_2_VALUE = 2 * 1000000 * TOKEN_FACTOR;
uint256 public constant CAT_3_VALUE = 3 * 1000000 * TOKEN_FACTOR;
uint256 public constant CAT_4_VALUE = 4 * 1000000 * TOKEN_FACTOR;
uint256 public constant CAT_5_VALUE = 5 * 1000000 * TOKEN_FACTOR;
enum PoolType {
MinerPool,
ReferralPool
}
uint16 private _poolType;
PoolType private _poolType;
mapping(address => bool) _fundedMiners;
constructor(uint16 poolType, address tokenAddress)
constructor(PoolType poolType, address tokenAddress)
ERC20TokenHolder(tokenAddress)
AlgoCoreTeamRole()
public {
@@ -39,24 +37,13 @@ contract AlgoPool is ERC20TokenHolder, AlgoCoreTeamRole {
require(minerCategory >= 0 && minerCategory <= 5);
uint256 value = 0;
uint256 value = getCapacityByCategory(minerCategory);
if(minerCategory == 0) {
value = CAT_0_VALUE;
} else if(minerCategory == 1) {
value = CAT_1_VALUE;
} else if(minerCategory == 2) {
value = CAT_2_VALUE;
} else if(minerCategory == 3) {
value = CAT_3_VALUE;
} else if(minerCategory == 4) {
value = CAT_4_VALUE;
} else if(minerCategory == 5) {
value = CAT_5_VALUE;
// For referral pools only transfer the 10% of the category capacity.
if(_poolType == PoolType.ReferralPool) {
value = value * 10 / 100;
}
require(value > 0);
_fundedMiners[minerAddress] = true;
_token.safeTransfer(minerAddress, value);
}
@@ -2,6 +2,7 @@ pragma solidity 0.4.24;
contract IAlgoMiner {
function isAlgoMiner() public pure returns (bool);
function getMinerType() public view returns (uint8);
function getCategory() public view returns (uint8);
function isMining() public view returns (bool);
function getMiner() public view returns (address);
@@ -1 +1 @@
60806040523480156200001157600080fd5b50604051602080620010d083398101604052516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790556200006c90640100000000620000c7810204565b6200008033640100000000620000e5810204565b50600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a031916905562000193565b620000e260028264010000000062000e066200010082021704565b50565b620000e260038264010000000062000e066200010082021704565b600160a060020a03811615156200011657600080fd5b6200012b82826401000000006200015b810204565b156200013657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200017357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610f2d80620001a36000396000f3006080604052600436106100a05763ffffffff60e060020a6000350416630c08bf8881146100a55780632e6b6849146100bc578063341ccfcb146100dd57806334cdcf26146100fe5780633d19ab1314610133578063608d3d3d1461016757806374be75921461018857806381f909f3146101a957806399f4b251146101ca578063bb52c137146101df578063d43acc7914610206578063e9d618591461021b575b600080fd5b3480156100b157600080fd5b506100ba610230565b005b3480156100c857600080fd5b506100ba600160a060020a036004351661024e565b3480156100e957600080fd5b506100ba600160a060020a036004351661026e565b34801561010a57600080fd5b5061011f600160a060020a0360043516610457565b604080519115158252519081900360200190f35b34801561013f57600080fd5b5061014b600435610470565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b5061011f600160a060020a036004351661049f565b34801561019457600080fd5b506100ba600160a060020a03600435166104b2565b3480156101b557600080fd5b506100ba600160a060020a03600435166104cf565b3480156101d657600080fd5b506100ba610686565b3480156101eb57600080fd5b506101f4610bd1565b60408051918252519081900360200190f35b34801561021257600080fd5b506100ba610bdc565b34801561022757600080fd5b506100ba610be5565b6102393361049f565b151561024457600080fd5b61024c610bee565b565b6102573361049f565b151561026257600080fd5b61026b81610cb5565b50565b60008054819074010000000000000000000000000000000000000000900460ff161561029957600080fd5b6102a23361049f565b15156102ad57600080fd5b6004546103e8116102bd57600080fd5b600160a060020a038316600090815260056020526040902054156102e057600080fd5b82915081600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032157600080fd5b505af1158015610335573d6000803e3d6000fd5b505050506040513d602081101561034b57600080fd5b5051151561035857600080fd5b81600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561039657600080fd5b505af11580156103aa573d6000803e3d6000fd5b505050506040513d60208110156103c057600080fd5b50519050600060ff8216108015906103dc575060058160ff1611155b15156103e757600080fd5b505060048054600160a060020a039092166000818152600560205260408120849055600184018355919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b600061046a60028363ffffffff610cc616565b92915050565b600060048260010181548110151561048457fe5b600091825260209091200154600160a060020a031692915050565b600061046a60038363ffffffff610cc616565b6104bb33610457565b15156104c657600080fd5b61026b81610cfd565b60005474010000000000000000000000000000000000000000900460ff16156104f757600080fd5b6105003361049f565b151561050b57600080fd5b60045460011061051a57600080fd5b600454600214156105865760048054600190811061053457fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191690556001610567600482610ea0565b50600160a060020a03811660009081526005602052604081205561026b565b600454600160a060020a03821660009081526005602052604090205414610620576004805460001981019081106105b957fe5b6000918252602080832090910154600160a060020a03848116845260059092526040909220546004805492909316929181106105f157fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b60048054600019810190811061063257fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055600480549061066b906000198301610ea0565b50600160a060020a0316600090815260056020526040812055565b6000610690610ec4565b60008060008061069e610ec4565b60005474010000000000000000000000000000000000000000900460ff16156106c657600080fd5b6106cf33610457565b15156106da57600080fd5b6004546001106106e957600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561074f57600080fd5b505af1158015610763573d6000803e3d6000fd5b505050506040513d602081101561077957600080fd5b505196506000871161078a57600080fd5b600194505b6004548510156109395760048054869081106107a757fe5b9060005260206000200160009054906101000a9004600160a060020a0316935083600160a060020a03166319a74ab36040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b5050505060405Line truncated
60806040523480156200001157600080fd5b50604051602080620010d083398101604052516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790556200006c90640100000000620000c7810204565b6200008033640100000000620000e5810204565b50600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a031916905562000193565b620000e260028264010000000062000e066200010082021704565b50565b620000e260038264010000000062000e066200010082021704565b600160a060020a03811615156200011657600080fd5b6200012b82826401000000006200015b810204565b156200013657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200017357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610f2d80620001a36000396000f3006080604052600436106100a05763ffffffff60e060020a6000350416630c08bf8881146100a55780632e6b6849146100bc578063341ccfcb146100dd57806334cdcf26146100fe5780633d19ab1314610133578063608d3d3d1461016757806374be75921461018857806381f909f3146101a957806399f4b251146101ca578063bb52c137146101df578063d43acc7914610206578063e9d618591461021b575b600080fd5b3480156100b157600080fd5b506100ba610230565b005b3480156100c857600080fd5b506100ba600160a060020a036004351661024e565b3480156100e957600080fd5b506100ba600160a060020a036004351661026e565b34801561010a57600080fd5b5061011f600160a060020a0360043516610457565b604080519115158252519081900360200190f35b34801561013f57600080fd5b5061014b600435610470565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b5061011f600160a060020a036004351661049f565b34801561019457600080fd5b506100ba600160a060020a03600435166104b2565b3480156101b557600080fd5b506100ba600160a060020a03600435166104cf565b3480156101d657600080fd5b506100ba610686565b3480156101eb57600080fd5b506101f4610bd1565b60408051918252519081900360200190f35b34801561021257600080fd5b506100ba610bdc565b34801561022757600080fd5b506100ba610be5565b6102393361049f565b151561024457600080fd5b61024c610bee565b565b6102573361049f565b151561026257600080fd5b61026b81610cb5565b50565b60008054819074010000000000000000000000000000000000000000900460ff161561029957600080fd5b6102a23361049f565b15156102ad57600080fd5b6004546103e8116102bd57600080fd5b600160a060020a038316600090815260056020526040902054156102e057600080fd5b82915081600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032157600080fd5b505af1158015610335573d6000803e3d6000fd5b505050506040513d602081101561034b57600080fd5b5051151561035857600080fd5b81600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561039657600080fd5b505af11580156103aa573d6000803e3d6000fd5b505050506040513d60208110156103c057600080fd5b50519050600060ff8216108015906103dc575060058160ff1611155b15156103e757600080fd5b505060048054600160a060020a039092166000818152600560205260408120849055600184018355919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b600061046a60028363ffffffff610cc616565b92915050565b600060048260010181548110151561048457fe5b600091825260209091200154600160a060020a031692915050565b600061046a60038363ffffffff610cc616565b6104bb33610457565b15156104c657600080fd5b61026b81610cfd565b60005474010000000000000000000000000000000000000000900460ff16156104f757600080fd5b6105003361049f565b151561050b57600080fd5b60045460011061051a57600080fd5b600454600214156105865760048054600190811061053457fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191690556001610567600482610ea0565b50600160a060020a03811660009081526005602052604081205561026b565b600454600160a060020a03821660009081526005602052604090205414610620576004805460001981019081106105b957fe5b6000918252602080832090910154600160a060020a03848116845260059092526040909220546004805492909316929181106105f157fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b60048054600019810190811061063257fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055600480549061066b906000198301610ea0565b50600160a060020a0316600090815260056020526040812055565b6000610690610ec4565b60008060008061069e610ec4565b60005474010000000000000000000000000000000000000000900460ff16156106c657600080fd5b6106cf33610457565b15156106da57600080fd5b6004546001106106e957600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561074f57600080fd5b505af1158015610763573d6000803e3d6000fd5b505050506040513d602081101561077957600080fd5b505196506000871161078a57600080fd5b600194505b6004548510156109395760048054869081106107a757fe5b9060005260206000200160009054906101000a9004600160a060020a0316935083600160a060020a03166319a74ab36040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b5050505060405Line truncated
@@ -175,7 +175,7 @@
"type": "constructor"
}
],
"bytecode": "60806040523480156200001157600080fd5b50604051602080620010d083398101604052516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790556200006c90640100000000620000c7810204565b6200008033640100000000620000e5810204565b50600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a031916905562000193565b620000e260028264010000000062000e066200010082021704565b50565b620000e260038264010000000062000e066200010082021704565b600160a060020a03811615156200011657600080fd5b6200012b82826401000000006200015b810204565b156200013657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200017357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610f2d80620001a36000396000f3006080604052600436106100a05763ffffffff60e060020a6000350416630c08bf8881146100a55780632e6b6849146100bc578063341ccfcb146100dd57806334cdcf26146100fe5780633d19ab1314610133578063608d3d3d1461016757806374be75921461018857806381f909f3146101a957806399f4b251146101ca578063bb52c137146101df578063d43acc7914610206578063e9d618591461021b575b600080fd5b3480156100b157600080fd5b506100ba610230565b005b3480156100c857600080fd5b506100ba600160a060020a036004351661024e565b3480156100e957600080fd5b506100ba600160a060020a036004351661026e565b34801561010a57600080fd5b5061011f600160a060020a0360043516610457565b604080519115158252519081900360200190f35b34801561013f57600080fd5b5061014b600435610470565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b5061011f600160a060020a036004351661049f565b34801561019457600080fd5b506100ba600160a060020a03600435166104b2565b3480156101b557600080fd5b506100ba600160a060020a03600435166104cf565b3480156101d657600080fd5b506100ba610686565b3480156101eb57600080fd5b506101f4610bd1565b60408051918252519081900360200190f35b34801561021257600080fd5b506100ba610bdc565b34801561022757600080fd5b506100ba610be5565b6102393361049f565b151561024457600080fd5b61024c610bee565b565b6102573361049f565b151561026257600080fd5b61026b81610cb5565b50565b60008054819074010000000000000000000000000000000000000000900460ff161561029957600080fd5b6102a23361049f565b15156102ad57600080fd5b6004546103e8116102bd57600080fd5b600160a060020a038316600090815260056020526040902054156102e057600080fd5b82915081600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032157600080fd5b505af1158015610335573d6000803e3d6000fd5b505050506040513d602081101561034b57600080fd5b5051151561035857600080fd5b81600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561039657600080fd5b505af11580156103aa573d6000803e3d6000fd5b505050506040513d60208110156103c057600080fd5b50519050600060ff8216108015906103dc575060058160ff1611155b15156103e757600080fd5b505060048054600160a060020a039092166000818152600560205260408120849055600184018355919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b600061046a60028363ffffffff610cc616565b92915050565b600060048260010181548110151561048457fe5b600091825260209091200154600160a060020a031692915050565b600061046a60038363ffffffff610cc616565b6104bb33610457565b15156104c657600080fd5b61026b81610cfd565b60005474010000000000000000000000000000000000000000900460ff16156104f757600080fd5b6105003361049f565b151561050b57600080fd5b60045460011061051a57600080fd5b600454600214156105865760048054600190811061053457fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191690556001610567600482610ea0565b50600160a060020a03811660009081526005602052604081205561026b565b600454600160a060020a03821660009081526005602052604090205414610620576004805460001981019081106105b957fe5b6000918252602080832090910154600160a060020a03848116845260059092526040909220546004805492909316929181106105f157fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b60048054600019810190811061063257fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055600480549061066b906000198301610ea0565b50600160a060020a0316600090815260056020526040812055565b6000610690610ec4565b60008060008061069e610ec4565b60005474010000000000000000000000000000000000000000900460ff16156106c657600080fd5b6106cf33610457565b15156106da57600080fd5b6004546001106106e957600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561074f57600080fd5b505af1158015610763573d6000803e3d6000fd5b505050506040513d602081101561077957600080fd5b505196506000871161078a57600080fd5b600194505b6004548510156109395760048054869081106107a757fe5b9060005260206000200160009054906101000a9004600160a060020a0316935083600160a060020a03166319a74ab36040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000Line truncated
"bytecode": "60806040523480156200001157600080fd5b50604051602080620010d083398101604052516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790556200006c90640100000000620000c7810204565b6200008033640100000000620000e5810204565b50600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a031916905562000193565b620000e260028264010000000062000e066200010082021704565b50565b620000e260038264010000000062000e066200010082021704565b600160a060020a03811615156200011657600080fd5b6200012b82826401000000006200015b810204565b156200013657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200017357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610f2d80620001a36000396000f3006080604052600436106100a05763ffffffff60e060020a6000350416630c08bf8881146100a55780632e6b6849146100bc578063341ccfcb146100dd57806334cdcf26146100fe5780633d19ab1314610133578063608d3d3d1461016757806374be75921461018857806381f909f3146101a957806399f4b251146101ca578063bb52c137146101df578063d43acc7914610206578063e9d618591461021b575b600080fd5b3480156100b157600080fd5b506100ba610230565b005b3480156100c857600080fd5b506100ba600160a060020a036004351661024e565b3480156100e957600080fd5b506100ba600160a060020a036004351661026e565b34801561010a57600080fd5b5061011f600160a060020a0360043516610457565b604080519115158252519081900360200190f35b34801561013f57600080fd5b5061014b600435610470565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b5061011f600160a060020a036004351661049f565b34801561019457600080fd5b506100ba600160a060020a03600435166104b2565b3480156101b557600080fd5b506100ba600160a060020a03600435166104cf565b3480156101d657600080fd5b506100ba610686565b3480156101eb57600080fd5b506101f4610bd1565b60408051918252519081900360200190f35b34801561021257600080fd5b506100ba610bdc565b34801561022757600080fd5b506100ba610be5565b6102393361049f565b151561024457600080fd5b61024c610bee565b565b6102573361049f565b151561026257600080fd5b61026b81610cb5565b50565b60008054819074010000000000000000000000000000000000000000900460ff161561029957600080fd5b6102a23361049f565b15156102ad57600080fd5b6004546103e8116102bd57600080fd5b600160a060020a038316600090815260056020526040902054156102e057600080fd5b82915081600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032157600080fd5b505af1158015610335573d6000803e3d6000fd5b505050506040513d602081101561034b57600080fd5b5051151561035857600080fd5b81600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561039657600080fd5b505af11580156103aa573d6000803e3d6000fd5b505050506040513d60208110156103c057600080fd5b50519050600060ff8216108015906103dc575060058160ff1611155b15156103e757600080fd5b505060048054600160a060020a039092166000818152600560205260408120849055600184018355919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b600061046a60028363ffffffff610cc616565b92915050565b600060048260010181548110151561048457fe5b600091825260209091200154600160a060020a031692915050565b600061046a60038363ffffffff610cc616565b6104bb33610457565b15156104c657600080fd5b61026b81610cfd565b60005474010000000000000000000000000000000000000000900460ff16156104f757600080fd5b6105003361049f565b151561050b57600080fd5b60045460011061051a57600080fd5b600454600214156105865760048054600190811061053457fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191690556001610567600482610ea0565b50600160a060020a03811660009081526005602052604081205561026b565b600454600160a060020a03821660009081526005602052604090205414610620576004805460001981019081106105b957fe5b6000918252602080832090910154600160a060020a03848116845260059092526040909220546004805492909316929181106105f157fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b60048054600019810190811061063257fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055600480549061066b906000198301610ea0565b50600160a060020a0316600090815260056020526040812055565b6000610690610ec4565b60008060008061069e610ec4565b60005474010000000000000000000000000000000000000000900460ff16156106c657600080fd5b6106cf33610457565b15156106da57600080fd5b6004546001106106e957600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561074f57600080fd5b505af1158015610763573d6000803e3d6000fd5b505050506040513d602081101561077957600080fd5b505196506000871161078a57600080fd5b600194505b6004548510156109395760048054869081106107a757fe5b9060005260206000200160009054906101000a9004600160a060020a0316935083600160a060020a03166319a74ab36040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000Line truncated
"functionHashes": {
"addCoreTeam(address)": "2e6b6849",
"addSystem(address)": "74be7592",
@@ -1 +1 @@
[{"constant":false,"inputs":[],"name":"terminate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pauseMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isAlgoMiner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"isMining","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"startMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newMinerAddress","type":"address"}],"name":"migrateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addSupervisor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMiner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSystem","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"stopAndRemoveOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"resumeMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCategory","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSupervisor","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"mine","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"deactivateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwnerAddress","type":"address"}],"name":"resetMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"activateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSupervisor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"DAYS_PER_YEAR","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"stopMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"minerType","type":"uint16"},{"name":"category","type":"uint8"},{"name":"minerAccountAddress","type":"address"},{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
[{"constant":false,"inputs":[],"name":"terminate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pauseMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isAlgoMiner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"isMining","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"startMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newMinerAddress","type":"address"}],"name":"migrateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addSupervisor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMiner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getReferral","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSystem","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"stopAndRemoveOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentDay","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"resumeMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMinerType","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCategory","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSupervisor","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwnerAddress","type":"address"},{"name":"newReferralAddress","type":"address"}],"name":"resetMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"mine","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"deactivateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"activateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSupervisor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"DAYS_PER_YEAR","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentYearSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentYear","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"stopMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"minerType","type":"uint8"},{"name":"category","type":"uint8"},{"name":"minerAccountAddress","type":"address"},{"name":"referralAccountAddress","type":"address"},{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
@@ -1 +1 @@
60806040523480156200001157600080fd5b506040516080806200122083398101604090815281516020830151918301516060909301516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a038416179055919391620000819064010000000062000126810204565b620000953364010000000062000144810204565b620000a9336401000000006200015f810204565b60008360ff1610158015620000c2575060058360ff1611155b1515620000ce57600080fd5b506005805461ffff191661ffff949094169390931762ff000019166201000060ff939093169290920291909117630100000060b860020a0319166301000000600160a060020a0392909216919091021790556200020d565b6200014160028264010000000062000f3d6200017a82021704565b50565b6200014160038264010000000062000f3d6200017a82021704565b6200014160048264010000000062000f3d6200017a82021704565b600160a060020a03811615156200019057600080fd5b620001a58282640100000000620001d5810204565b15620001b057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a0382161515620001ed57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b611003806200021d6000396000f3006080604052600436106101485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c08bf88811461014d578063162f986d146101645780631777fb4b1461017957806319a74ab3146101a257806321b79d98146101b7578063231d4e2a146101cc57806329d10b6e146101ed5780632e6b68491461020e578063302c11ca1461022f57806334cdcf2614610260578063363aa6c714610281578063427534a414610296578063608d3d3d146102ab57806374be7592146102cc57806380258e47146102ed57806381a244591461031857806399f4b251146103395780639e614ca01461034e578063ada436e914610363578063b2a32cd514610384578063be95249414610399578063c6846ef8146103ae578063d43acc79146103d5578063da408679146103ea578063e9d61859146103ff575b600080fd5b34801561015957600080fd5b50610162610414565b005b34801561017057600080fd5b50610162610432565b34801561018557600080fd5b5061018e6104a1565b604080519115158252519081900360200190f35b3480156101ae57600080fd5b5061018e6104a6565b3480156101c357600080fd5b506101626104dd565b3480156101d857600080fd5b50610162600160a060020a0360043516610577565b3480156101f957600080fd5b50610162600160a060020a0360043516610663565b34801561021a57600080fd5b50610162600160a060020a0360043516610680565b34801561023b57600080fd5b5061024461069d565b60408051600160a060020a039092168252519081900360200190f35b34801561026c57600080fd5b5061018e600160a060020a03600435166106b3565b34801561028d57600080fd5b506101626106cc565b3480156102a257600080fd5b50610162610764565b3480156102b757600080fd5b5061018e600160a060020a03600435166107d0565b3480156102d857600080fd5b50610162600160a060020a03600435166107e3565b3480156102f957600080fd5b50610302610800565b6040805160ff9092168252519081900360200190f35b34801561032457600080fd5b5061018e600160a060020a036004351661080f565b34801561034557600080fd5b50610162610822565b34801561035a57600080fd5b50610162610a1e565b34801561036f57600080fd5b50610162600160a060020a0360043516610a92565b34801561039057600080fd5b50610162610b2b565b3480156103a557600080fd5b50610162610c45565b3480156103ba57600080fd5b506103c3610c4e565b60408051918252519081900360200190f35b3480156103e157600080fd5b50610162610c54565b3480156103f657600080fd5b50610162610c5d565b34801561040b57600080fd5b50610162610cf2565b61041d336107d0565b151561042857600080fd5b610430610cfb565b565b60005460a060020a900460ff161561044957600080fd5b6104523361080f565b151561045d57600080fd5b600160055460b860020a900460ff16600381111561047757fe5b1461048157600080fd5b600580546002919060b860020a60ff02191660b860020a835b0217905550565b600190565b6000600160055460b860020a900460ff1660038111156104c257fe5b1480156104d8575060055460c060020a900460ff165b905090565b60005460a060020a900460ff16156104f457600080fd5b60055463010000009004600160a060020a0316331461051257600080fd5b600160055460b860020a900460ff16600381111561052c57fe5b1461053657600080fd5b60055460c060020a900460ff161561054d57600080fd5b6005805478ff000000000000000000000000000000000000000000000000191660c060020a179055565b610580336107d0565b151561058b57600080fd5b600060055460b860020a900460ff1660038111156105a557fe5b146105af57600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610660928492600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b15801561061b57600080fd5b505af115801561062f573d6000803e3d6000fd5b505050506040513d602081101561064557600080fd5b5051600154600160a060020a0316919063ffffffff610dc216565b50565b61066c3361080f565b151561067757600080fd5b61066081610e7a565b610689336107d0565b151561069457600080fd5b61066081610e8b565b60055463010000009004600160a060020a031690565b60006106c660028363ffffffff610e9c16565b92915050565b60005460a060020a900460ff16156106e357600080fd5b6106ec3361080f565b15156106f757600080fd5b600360055460b860020a900460ff16600381111561071157fe5b141561071c57600080fd5b6005805460b860020a60ff021916770300000000000000000000000000000000000000000000001778ff00ffffffffffffffffffffffffffffffffffffffff00000019169055565b60005460a060020a900460ff161561077b57600080fd5b6107843361080f565b151561078f57600080fd5b600260055460b860020a900460ff1660038111156107aLine truncated
60806040523480156200001157600080fd5b5060405160a080620014c7833981016040908152815160208301519183015160608401516080909401516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790559294919262000087906401000000006200014c810204565b6200009b336401000000006200016a810204565b620000af3364010000000062000185810204565b60008460ff1610158015620000c8575060058460ff1611155b1515620000d457600080fd5b6005805486919060ff191660018381811115620000ed57fe5b0217905550506005805461ff00191661010060ff9590951694909402939093176201000060b060020a03191662010000600160a060020a03938416021790925560068054600160a060020a031916929091169190911790555062000233565b62000167600282640100000000620011be620001a082021704565b50565b62000167600382640100000000620011be620001a082021704565b62000167600482640100000000620011be620001a082021704565b600160a060020a0381161515620001b657600080fd5b620001cb8282640100000000620001fb810204565b15620001d657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200021357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61128480620002436000396000f30060806040526004361061017f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c08bf888114610184578063162f986d1461019b5780631777fb4b146101b057806319a74ab3146101d957806321b79d98146101ee578063231d4e2a1461020357806329d10b6e146102245780632e6b684914610245578063302c11ca14610266578063329b1c921461029757806334cdcf26146102ac578063363aa6c7146102cd5780633e6968b6146102e2578063427534a41461030e5780634969ae7014610323578063608d3d3d1461034e57806374be75921461036f57806380258e471461039057806381a24459146103a55780638329138f146103c657806399f4b251146103ed5780639e614ca014610402578063b2a32cd514610417578063be9524941461042c578063c6846ef814610441578063cdfd0f6414610468578063ce41607a1461047d578063d43acc7914610492578063da408679146104a7578063e9d61859146104bc575b600080fd5b34801561019057600080fd5b506101996104d1565b005b3480156101a757600080fd5b506101996104ef565b3480156101bc57600080fd5b506101c561055e565b604080519115158252519081900360200190f35b3480156101e557600080fd5b506101c5610563565b3480156101fa57600080fd5b5061019961059a565b34801561020f57600080fd5b50610199600160a060020a0360043516610630565b34801561023057600080fd5b50610199600160a060020a036004351661071c565b34801561025157600080fd5b50610199600160a060020a0360043516610739565b34801561027257600080fd5b5061027b610756565b60408051600160a060020a039092168252519081900360200190f35b3480156102a357600080fd5b5061027b61076b565b3480156102b857600080fd5b506101c5600160a060020a036004351661077a565b3480156102d957600080fd5b50610199610795565b3480156102ee57600080fd5b506102f7610846565b6040805161ffff9092168252519081900360200190f35b34801561031a57600080fd5b50610199610857565b34801561032f57600080fd5b506103386108c3565b6040805160ff9092168252519081900360200190f35b34801561035a57600080fd5b506101c5600160a060020a03600435166108d7565b34801561037b57600080fd5b50610199600160a060020a03600435166108ea565b34801561039c57600080fd5b50610338610907565b3480156103b157600080fd5b506101c5600160a060020a0360043516610915565b3480156103d257600080fd5b50610199600160a060020a0360043581169060243516610928565b3480156103f957600080fd5b506101996109db565b34801561040e57600080fd5b50610199610c2e565b34801561042357600080fd5b50610199610c9f565b34801561043857600080fd5b50610199610dfd565b34801561044d57600080fd5b50610456610e06565b60408051918252519081900360200190f35b34801561047457600080fd5b50610456610e0c565b34801561048957600080fd5b50610338610e12565b34801561049e57600080fd5b50610199610e35565b3480156104b357600080fd5b50610199610e3e565b3480156104c857600080fd5b50610199610ecf565b6104da336108d7565b15156104e557600080fd5b6104ed610ed8565b565b60005460a060020a900460ff161561050657600080fd5b61050f33610915565b151561051a57600080fd5b600160065460a060020a900460ff16600381111561053457fe5b1461053e57600080fd5b600680546002919060a060020a60ff02191660a060020a835b0217905550565b600190565b6000600160065460a060020a900460ff16600381111561057f57fe5b148015610595575060065460a860020a900460ff165b905090565b60005460a060020a900460ff16156105b157600080fd5b600554620100009004600160a060020a031633146105ce57600080fd5b600160065460a060020a900460ff1660038111156105e857fe5b146105f257600080fd5b60065460a860020a900460ff161561060957600080fd5b6006805475ff000000000000000000000000000000000000000000191660a860020a179055565b610639336108d7565b151561064457600080fd5b600060065460a060020a900460ff16600381111561065e57fe5b1461066857600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610719928492600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156106d457600080fd5b505af11580156106e8573d6000803e3d6000fd5b505050506040513d60208110156106fe57600080fd5b5051600154600160a060020a0316919063ffffffff610f9f16565b50565b61072533610915565b151561073057600080fd5b61071981611057565b610742336108d7565b151561074d57600080fd5b61071981611068565b600554620100009004600160a060020a031690565b600654600160a060020a031690565b600061078d6Line truncated
@@ -111,6 +111,20 @@
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getReferral",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
@@ -139,6 +153,20 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getCurrentDay",
"outputs": [
{
"name": "",
"type": "uint16"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
@@ -148,6 +176,20 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getMinerType",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
@@ -214,6 +256,24 @@
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwnerAddress",
"type": "address"
},
{
"name": "newReferralAddress",
"type": "address"
}
],
"name": "resetMiner",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
@@ -232,20 +292,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwnerAddress",
"type": "address"
}
],
"name": "resetMiner",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
@@ -278,6 +324,34 @@
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getCurrentYearSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getCurrentYear",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
@@ -309,7 +383,7 @@
"inputs": [
{
"name": "minerType",
"type": "uint16"
"type": "uint8"
},
{
"name": "category",
@@ -319,6 +393,10 @@
"name": "minerAccountAddress",
"type": "address"
},
{
"name": "referralAccountAddress",
"type": "address"
},
{
"name": "tokenAddress",
"type": "address"
@@ -329,7 +407,7 @@
"type": "constructor"
}
],
"bytecode": "60806040523480156200001157600080fd5b506040516080806200122083398101604090815281516020830151918301516060909301516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a038416179055919391620000819064010000000062000126810204565b620000953364010000000062000144810204565b620000a9336401000000006200015f810204565b60008360ff1610158015620000c2575060058360ff1611155b1515620000ce57600080fd5b506005805461ffff191661ffff949094169390931762ff000019166201000060ff939093169290920291909117630100000060b860020a0319166301000000600160a060020a0392909216919091021790556200020d565b6200014160028264010000000062000f3d6200017a82021704565b50565b6200014160038264010000000062000f3d6200017a82021704565b6200014160048264010000000062000f3d6200017a82021704565b600160a060020a03811615156200019057600080fd5b620001a58282640100000000620001d5810204565b15620001b057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a0382161515620001ed57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b611003806200021d6000396000f3006080604052600436106101485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c08bf88811461014d578063162f986d146101645780631777fb4b1461017957806319a74ab3146101a257806321b79d98146101b7578063231d4e2a146101cc57806329d10b6e146101ed5780632e6b68491461020e578063302c11ca1461022f57806334cdcf2614610260578063363aa6c714610281578063427534a414610296578063608d3d3d146102ab57806374be7592146102cc57806380258e47146102ed57806381a244591461031857806399f4b251146103395780639e614ca01461034e578063ada436e914610363578063b2a32cd514610384578063be95249414610399578063c6846ef8146103ae578063d43acc79146103d5578063da408679146103ea578063e9d61859146103ff575b600080fd5b34801561015957600080fd5b50610162610414565b005b34801561017057600080fd5b50610162610432565b34801561018557600080fd5b5061018e6104a1565b604080519115158252519081900360200190f35b3480156101ae57600080fd5b5061018e6104a6565b3480156101c357600080fd5b506101626104dd565b3480156101d857600080fd5b50610162600160a060020a0360043516610577565b3480156101f957600080fd5b50610162600160a060020a0360043516610663565b34801561021a57600080fd5b50610162600160a060020a0360043516610680565b34801561023b57600080fd5b5061024461069d565b60408051600160a060020a039092168252519081900360200190f35b34801561026c57600080fd5b5061018e600160a060020a03600435166106b3565b34801561028d57600080fd5b506101626106cc565b3480156102a257600080fd5b50610162610764565b3480156102b757600080fd5b5061018e600160a060020a03600435166107d0565b3480156102d857600080fd5b50610162600160a060020a03600435166107e3565b3480156102f957600080fd5b50610302610800565b6040805160ff9092168252519081900360200190f35b34801561032457600080fd5b5061018e600160a060020a036004351661080f565b34801561034557600080fd5b50610162610822565b34801561035a57600080fd5b50610162610a1e565b34801561036f57600080fd5b50610162600160a060020a0360043516610a92565b34801561039057600080fd5b50610162610b2b565b3480156103a557600080fd5b50610162610c45565b3480156103ba57600080fd5b506103c3610c4e565b60408051918252519081900360200190f35b3480156103e157600080fd5b50610162610c54565b3480156103f657600080fd5b50610162610c5d565b34801561040b57600080fd5b50610162610cf2565b61041d336107d0565b151561042857600080fd5b610430610cfb565b565b60005460a060020a900460ff161561044957600080fd5b6104523361080f565b151561045d57600080fd5b600160055460b860020a900460ff16600381111561047757fe5b1461048157600080fd5b600580546002919060b860020a60ff02191660b860020a835b0217905550565b600190565b6000600160055460b860020a900460ff1660038111156104c257fe5b1480156104d8575060055460c060020a900460ff165b905090565b60005460a060020a900460ff16156104f457600080fd5b60055463010000009004600160a060020a0316331461051257600080fd5b600160055460b860020a900460ff16600381111561052c57fe5b1461053657600080fd5b60055460c060020a900460ff161561054d57600080fd5b6005805478ff000000000000000000000000000000000000000000000000191660c060020a179055565b610580336107d0565b151561058b57600080fd5b600060055460b860020a900460ff1660038111156105a557fe5b146105af57600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610660928492600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b15801561061b57600080fd5b505af115801561062f573d6000803e3d6000fd5b505050506040513d602081101561064557600080fd5b5051600154600160a060020a0316919063ffffffff610dc216565b50565b61066c3361080f565b151561067757600080fd5b61066081610e7a565b610689336107d0565b151561069457600080fd5b61066081610e8b565b60055463010000009004600160a060020a031690565b60006106c660028363ffffffff610e9c16565b92915050565b60005460a060020a900460ff16156106e357600080fd5b6106ec3361080f565b15156106f757600080fd5b600360055460b860020a900460ff16600381111561071157fe5b141561071c57600080fd5b6005805460b860020a60ff021916770300000000000000000000000000000000000000000000001778ff00ffffffffffffffffffffffffffffffffffffffff00000019169055565b60005460a060020a900460ff161561077b57600080fd5b6107843361080f565b151561078f57600080fd5b600260055460b860020a900460ffLine truncated
"bytecode": "60806040523480156200001157600080fd5b5060405160a080620014c7833981016040908152815160208301519183015160608401516080909401516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790559294919262000087906401000000006200014c810204565b6200009b336401000000006200016a810204565b620000af3364010000000062000185810204565b60008460ff1610158015620000c8575060058460ff1611155b1515620000d457600080fd5b6005805486919060ff191660018381811115620000ed57fe5b0217905550506005805461ff00191661010060ff9590951694909402939093176201000060b060020a03191662010000600160a060020a03938416021790925560068054600160a060020a031916929091169190911790555062000233565b62000167600282640100000000620011be620001a082021704565b50565b62000167600382640100000000620011be620001a082021704565b62000167600482640100000000620011be620001a082021704565b600160a060020a0381161515620001b657600080fd5b620001cb8282640100000000620001fb810204565b15620001d657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200021357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61128480620002436000396000f30060806040526004361061017f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c08bf888114610184578063162f986d1461019b5780631777fb4b146101b057806319a74ab3146101d957806321b79d98146101ee578063231d4e2a1461020357806329d10b6e146102245780632e6b684914610245578063302c11ca14610266578063329b1c921461029757806334cdcf26146102ac578063363aa6c7146102cd5780633e6968b6146102e2578063427534a41461030e5780634969ae7014610323578063608d3d3d1461034e57806374be75921461036f57806380258e471461039057806381a24459146103a55780638329138f146103c657806399f4b251146103ed5780639e614ca014610402578063b2a32cd514610417578063be9524941461042c578063c6846ef814610441578063cdfd0f6414610468578063ce41607a1461047d578063d43acc7914610492578063da408679146104a7578063e9d61859146104bc575b600080fd5b34801561019057600080fd5b506101996104d1565b005b3480156101a757600080fd5b506101996104ef565b3480156101bc57600080fd5b506101c561055e565b604080519115158252519081900360200190f35b3480156101e557600080fd5b506101c5610563565b3480156101fa57600080fd5b5061019961059a565b34801561020f57600080fd5b50610199600160a060020a0360043516610630565b34801561023057600080fd5b50610199600160a060020a036004351661071c565b34801561025157600080fd5b50610199600160a060020a0360043516610739565b34801561027257600080fd5b5061027b610756565b60408051600160a060020a039092168252519081900360200190f35b3480156102a357600080fd5b5061027b61076b565b3480156102b857600080fd5b506101c5600160a060020a036004351661077a565b3480156102d957600080fd5b50610199610795565b3480156102ee57600080fd5b506102f7610846565b6040805161ffff9092168252519081900360200190f35b34801561031a57600080fd5b50610199610857565b34801561032f57600080fd5b506103386108c3565b6040805160ff9092168252519081900360200190f35b34801561035a57600080fd5b506101c5600160a060020a03600435166108d7565b34801561037b57600080fd5b50610199600160a060020a03600435166108ea565b34801561039c57600080fd5b50610338610907565b3480156103b157600080fd5b506101c5600160a060020a0360043516610915565b3480156103d257600080fd5b50610199600160a060020a0360043581169060243516610928565b3480156103f957600080fd5b506101996109db565b34801561040e57600080fd5b50610199610c2e565b34801561042357600080fd5b50610199610c9f565b34801561043857600080fd5b50610199610dfd565b34801561044d57600080fd5b50610456610e06565b60408051918252519081900360200190f35b34801561047457600080fd5b50610456610e0c565b34801561048957600080fd5b50610338610e12565b34801561049e57600080fd5b50610199610e35565b3480156104b357600080fd5b50610199610e3e565b3480156104c857600080fd5b50610199610ecf565b6104da336108d7565b15156104e557600080fd5b6104ed610ed8565b565b60005460a060020a900460ff161561050657600080fd5b61050f33610915565b151561051a57600080fd5b600160065460a060020a900460ff16600381111561053457fe5b1461053e57600080fd5b600680546002919060a060020a60ff02191660a060020a835b0217905550565b600190565b6000600160065460a060020a900460ff16600381111561057f57fe5b148015610595575060065460a860020a900460ff165b905090565b60005460a060020a900460ff16156105b157600080fd5b600554620100009004600160a060020a031633146105ce57600080fd5b600160065460a060020a900460ff1660038111156105e857fe5b146105f257600080fd5b60065460a860020a900460ff161561060957600080fd5b6006805475ff000000000000000000000000000000000000000000191660a860020a179055565b610639336108d7565b151561064457600080fd5b600060065460a060020a900460ff16600381111561065e57fe5b1461066857600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610719928492600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156106d457600080fd5b505af11580156106e8573d6000803e3d6000fd5b505050506040513d60208110156106fe57600080fd5b5051600154600160a060020a0316919063ffffffff610f9f16565b50565b61072533610915565b151561073057600080fd5b61071981611057565b610742336108d7565b151561074d57600080fd5b61071981611068565b600554620100009004600160a060020a031690565b600654600160a060020a0316Line truncated
"functionHashes": {
"DAYS_PER_YEAR()": "c6846ef8",
"activateMiner()": "b2a32cd5",
@@ -338,7 +416,12 @@
"addSystem(address)": "74be7592",
"deactivateMiner()": "9e614ca0",
"getCategory()": "80258e47",
"getCurrentDay()": "3e6968b6",
"getCurrentYear()": "ce41607a",
"getCurrentYearSupply()": "cdfd0f64",
"getMiner()": "302c11ca",
"getMinerType()": "4969ae70",
"getReferral()": "329b1c92",
"isAlgoMiner()": "1777fb4b",
"isCoreTeam(address)": "608d3d3d",
"isMining()": "19a74ab3",
@@ -350,7 +433,7 @@
"renounceCoreTeam()": "d43acc79",
"renounceSupervisor()": "be952494",
"renounceSystem()": "e9d61859",
"resetMiner(address)": "ada436e9",
"resetMiner(address,address)": "8329138f",
"resumeMining()": "427534a4",
"startMining()": "21b79d98",
"stopAndRemoveOwnership()": "363aa6c7",
@@ -359,19 +442,24 @@
},
"gasEstimates": {
"creation": {
"codeDepositCost": "819800",
"codeDepositCost": "948000",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"DAYS_PER_YEAR()": "646",
"DAYS_PER_YEAR()": "712",
"activateMiner()": "infinite",
"addCoreTeam(address)": "infinite",
"addSupervisor(address)": "infinite",
"addSystem(address)": "infinite",
"deactivateMiner()": "infinite",
"getCategory()": "718",
"getCategory()": "784",
"getCurrentDay()": "737",
"getCurrentYear()": "982",
"getCurrentYearSupply()": "934",
"getMiner()": "724",
"getMinerType()": "744",
"getReferral()": "735",
"isAlgoMiner()": "234",
"isCoreTeam(address)": "infinite",
"isMining()": "881",
@@ -383,11 +471,11 @@
"renounceCoreTeam()": "infinite",
"renounceSupervisor()": "infinite",
"renounceSystem()": "infinite",
"resetMiner(address)": "infinite",
"resetMiner(address,address)": "infinite",
"resumeMining()": "infinite",
"startMining()": "21742",
"stopAndRemoveOwnership()": "infinite",
"stopMining()": "22094",
"stopMining()": "22204",
"terminate()": "infinite"
}
}
@@ -1 +1 @@
[{"constant":false,"inputs":[],"name":"terminate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"trasferToMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"TOKEN_FACTOR","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"CAT_4_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_1_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_3_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_0_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_5_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_2_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"poolType","type":"uint16"},{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
[{"constant":false,"inputs":[],"name":"terminate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"trasferToMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"poolType","type":"uint8"},{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
@@ -1 +1 @@
608060405234801561001057600080fd5b5060405160408061091a8339810160405280516020909101516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a03841617905561006f9064010000000061008b810204565b506003805461ffff191661ffff92909216919091179055610134565b6100a36002826401000000006107116100a682021704565b50565b600160a060020a03811615156100bb57600080fd5b6100ce82826401000000006100fd810204565b156100d857600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561011457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6107d7806101436000396000f3006080604052600436106100a05763ffffffff60e060020a6000350416630c08bf8881146100a55780632296f4c7146100bc57806325109e8b146100dd5780632e6b684914610104578063455acbcd14610125578063492fba841461013a57806349dc9ed01461014f578063608d3d3d146101645780639fc3c98314610199578063a89febb2146101ae578063aed6183f146101c3578063d43acc79146101d8575b600080fd5b3480156100b157600080fd5b506100ba6101ed565b005b3480156100c857600080fd5b506100ba600160a060020a036004351661020b565b3480156100e957600080fd5b506100f2610475565b60408051918252519081900360200190f35b34801561011057600080fd5b506100ba600160a060020a0360043516610481565b34801561013157600080fd5b506100f26104a1565b34801561014657600080fd5b506100f26104b0565b34801561015b57600080fd5b506100f26104be565b34801561017057600080fd5b50610185600160a060020a03600435166104cd565b604080519115158252519081900360200190f35b3480156101a557600080fd5b506100f26104e6565b3480156101ba57600080fd5b506100f26104f4565b3480156101cf57600080fd5b506100f2610503565b3480156101e457600080fd5b506100ba610512565b6101f6336104cd565b151561020157600080fd5b61020961051b565b565b600080548190819074010000000000000000000000000000000000000000900460ff161561023857600080fd5b610241336104cd565b151561024c57600080fd5b600160a060020a03841660009081526004602052604090205460ff161561027257600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156102b357600080fd5b505af11580156102c7573d6000803e3d6000fd5b505050506040513d60208110156102dd57600080fd5b505115156102ea57600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032857600080fd5b505af115801561033c573d6000803e3d6000fd5b505050506040513d602081101561035257600080fd5b50519150600060ff83161080159061036e575060058260ff1611155b151561037957600080fd5b50600060ff82161515610397575069152d02c7e14af6800000610428565b8160ff16600114156103b4575069d3c21bcecceda1000000610428565b8160ff16600214156103d257506a01a784379d99db42000000610428565b8160ff16600314156103f057506a027b46536c66c8e3000000610428565b8160ff166004141561040e57506a034f086f3b33b684000000610428565b8160ff166005141561042857506a0422ca8b0a00a4250000005b6000811161043557600080fd5b600160a060020a038085166000908152600460205260409020805460ff191660019081179091555461046f9116858363ffffffff6105e216565b50505050565b670de0b6b3a764000081565b61048a336104cd565b151561049557600080fd5b61049e81610681565b50565b6a034f086f3b33b68400000081565b69d3c21bcecceda100000081565b6a027b46536c66c8e300000081565b60006104e060028363ffffffff61069216565b92915050565b69152d02c7e14af680000081565b6a0422ca8b0a00a42500000081565b6a01a784379d99db4200000081565b610209336106c9565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561058057600080fd5b505af1158015610594573d6000803e3d6000fd5b505050506040513d60208110156105aa57600080fd5b5051905060008111156105da576000546001546105da91600160a060020a0391821691168363ffffffff6105e216565b61049e6106da565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561064557600080fd5b505af1158015610659573d6000803e3d6000fd5b505050506040513d602081101561066f57600080fd5b5051151561067c57600080fd5b505050565b61049e60028263ffffffff61071116565b6000600160a060020a03821615156106a957600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61049e60028263ffffffff61075f16565b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a038116151561072657600080fd5b6107308282610692565b1561073a57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561077457600080fd5b61077e8282610692565b151561078957600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a7230582003c6fe797e016b5da34d582d5503b392dfdb98114c82abcb7165886533dc93b80029
608060405234801561001057600080fd5b506040516040806107f28339810160405280516020909101516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a03841617905561006f90640100000000610093810204565b6003805483919060ff19166001838181111561008757fe5b0217905550505061013c565b6100ab6002826401000000006105e16100ae82021704565b50565b600160a060020a03811615156100c357600080fd5b6100d68282640100000000610105810204565b156100e057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561011c57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6106a78061014b6000396000f3006080604052600436106100535763ffffffff60e060020a6000350416630c08bf8881146100585780632296f4c71461006f5780632e6b684914610090578063608d3d3d146100b1578063d43acc79146100e6575b600080fd5b34801561006457600080fd5b5061006d6100fb565b005b34801561007b57600080fd5b5061006d600160a060020a0360043516610119565b34801561009c57600080fd5b5061006d600160a060020a03600435166102f5565b3480156100bd57600080fd5b506100d2600160a060020a0360043516610315565b604080519115158252519081900360200190f35b3480156100f257600080fd5b5061006d610330565b61010433610315565b151561010f57600080fd5b610117610339565b565b600080548190819074010000000000000000000000000000000000000000900460ff161561014657600080fd5b61014f33610315565b151561015a57600080fd5b600160a060020a03841660009081526004602052604090205460ff161561018057600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156101c157600080fd5b505af11580156101d5573d6000803e3d6000fd5b505050506040513d60208110156101eb57600080fd5b505115156101f857600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561023657600080fd5b505af115801561024a573d6000803e3d6000fd5b505050506040513d602081101561026057600080fd5b50519150600060ff83161080159061027c575060058260ff1611155b151561028757600080fd5b61029082610400565b9050600160035460ff1660018111156102a557fe5b14156102b5576064600a82020490505b600160a060020a038085166000908152600460205260409020805460ff19166001908117909155546102ef9116858363ffffffff6104b216565b50505050565b6102fe33610315565b151561030957600080fd5b61031281610551565b50565b600061032860028363ffffffff61056216565b90505b919050565b61011733610599565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561039e57600080fd5b505af11580156103b2573d6000803e3d6000fd5b505050506040513d60208110156103c857600080fd5b5051905060008111156103f8576000546001546103f891600160a060020a0391821691168363ffffffff6104b216565b6103126105aa565b600060ff8216151561041d575069152d02c7e14af680000061032b565b8160ff166001141561043a575069d3c21bcecceda100000061032b565b8160ff166002141561045857506a01a784379d99db4200000061032b565b8160ff166003141561047657506a027b46536c66c8e300000061032b565b8160ff166004141561049457506a034f086f3b33b68400000061032b565b8160ff166005141561032b57506a0422ca8b0a00a42500000061032b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561051557600080fd5b505af1158015610529573d6000803e3d6000fd5b505050506040513d602081101561053f57600080fd5b5051151561054c57600080fd5b505050565b61031260028263ffffffff6105e116565b6000600160a060020a038216151561057957600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61031260028263ffffffff61062f16565b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a03811615156105f657600080fd5b6106008282610562565b1561060a57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561064457600080fd5b61064e8282610562565b151561065957600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a723058208317cc38f72fdbf4d19029db12a6c784275ab5dfd7521863b2c79aee26e6effb0029
@@ -23,20 +23,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "TOKEN_FACTOR",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
@@ -51,48 +37,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "CAT_4_VALUE",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "CAT_1_VALUE",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "CAT_3_VALUE",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
@@ -112,48 +56,6 @@
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "CAT_0_VALUE",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "CAT_5_VALUE",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "CAT_2_VALUE",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
@@ -167,7 +69,7 @@
"inputs": [
{
"name": "poolType",
"type": "uint16"
"type": "uint8"
},
{
"name": "tokenAddress",
@@ -179,15 +81,8 @@
"type": "constructor"
}
],
"bytecode": "608060405234801561001057600080fd5b5060405160408061091a8339810160405280516020909101516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a03841617905561006f9064010000000061008b810204565b506003805461ffff191661ffff92909216919091179055610134565b6100a36002826401000000006107116100a682021704565b50565b600160a060020a03811615156100bb57600080fd5b6100ce82826401000000006100fd810204565b156100d857600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561011457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6107d7806101436000396000f3006080604052600436106100a05763ffffffff60e060020a6000350416630c08bf8881146100a55780632296f4c7146100bc57806325109e8b146100dd5780632e6b684914610104578063455acbcd14610125578063492fba841461013a57806349dc9ed01461014f578063608d3d3d146101645780639fc3c98314610199578063a89febb2146101ae578063aed6183f146101c3578063d43acc79146101d8575b600080fd5b3480156100b157600080fd5b506100ba6101ed565b005b3480156100c857600080fd5b506100ba600160a060020a036004351661020b565b3480156100e957600080fd5b506100f2610475565b60408051918252519081900360200190f35b34801561011057600080fd5b506100ba600160a060020a0360043516610481565b34801561013157600080fd5b506100f26104a1565b34801561014657600080fd5b506100f26104b0565b34801561015b57600080fd5b506100f26104be565b34801561017057600080fd5b50610185600160a060020a03600435166104cd565b604080519115158252519081900360200190f35b3480156101a557600080fd5b506100f26104e6565b3480156101ba57600080fd5b506100f26104f4565b3480156101cf57600080fd5b506100f2610503565b3480156101e457600080fd5b506100ba610512565b6101f6336104cd565b151561020157600080fd5b61020961051b565b565b600080548190819074010000000000000000000000000000000000000000900460ff161561023857600080fd5b610241336104cd565b151561024c57600080fd5b600160a060020a03841660009081526004602052604090205460ff161561027257600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156102b357600080fd5b505af11580156102c7573d6000803e3d6000fd5b505050506040513d60208110156102dd57600080fd5b505115156102ea57600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032857600080fd5b505af115801561033c573d6000803e3d6000fd5b505050506040513d602081101561035257600080fd5b50519150600060ff83161080159061036e575060058260ff1611155b151561037957600080fd5b50600060ff82161515610397575069152d02c7e14af6800000610428565b8160ff16600114156103b4575069d3c21bcecceda1000000610428565b8160ff16600214156103d257506a01a784379d99db42000000610428565b8160ff16600314156103f057506a027b46536c66c8e3000000610428565b8160ff166004141561040e57506a034f086f3b33b684000000610428565b8160ff166005141561042857506a0422ca8b0a00a4250000005b6000811161043557600080fd5b600160a060020a038085166000908152600460205260409020805460ff191660019081179091555461046f9116858363ffffffff6105e216565b50505050565b670de0b6b3a764000081565b61048a336104cd565b151561049557600080fd5b61049e81610681565b50565b6a034f086f3b33b68400000081565b69d3c21bcecceda100000081565b6a027b46536c66c8e300000081565b60006104e060028363ffffffff61069216565b92915050565b69152d02c7e14af680000081565b6a0422ca8b0a00a42500000081565b6a01a784379d99db4200000081565b610209336106c9565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561058057600080fd5b505af1158015610594573d6000803e3d6000fd5b505050506040513d60208110156105aa57600080fd5b5051905060008111156105da576000546001546105da91600160a060020a0391821691168363ffffffff6105e216565b61049e6106da565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561064557600080fd5b505af1158015610659573d6000803e3d6000fd5b505050506040513d602081101561066f57600080fd5b5051151561067c57600080fd5b505050565b61049e60028263ffffffff61071116565b6000600160a060020a03821615156106a957600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61049e60028263ffffffff61075f16565b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a038116151561072657600080fd5b6107308282610692565b1561073a57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561077457600080fd5b61077e8282610692565b151561078957600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a7230582003c6fe797e016b5da34d582d5503b392dfdb98114c82abcb7165886533dc93b80029",
"bytecode": "608060405234801561001057600080fd5b506040516040806107f28339810160405280516020909101516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a03841617905561006f90640100000000610093810204565b6003805483919060ff19166001838181111561008757fe5b0217905550505061013c565b6100ab6002826401000000006105e16100ae82021704565b50565b600160a060020a03811615156100c357600080fd5b6100d68282640100000000610105810204565b156100e057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561011c57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6106a78061014b6000396000f3006080604052600436106100535763ffffffff60e060020a6000350416630c08bf8881146100585780632296f4c71461006f5780632e6b684914610090578063608d3d3d146100b1578063d43acc79146100e6575b600080fd5b34801561006457600080fd5b5061006d6100fb565b005b34801561007b57600080fd5b5061006d600160a060020a0360043516610119565b34801561009c57600080fd5b5061006d600160a060020a03600435166102f5565b3480156100bd57600080fd5b506100d2600160a060020a0360043516610315565b604080519115158252519081900360200190f35b3480156100f257600080fd5b5061006d610330565b61010433610315565b151561010f57600080fd5b610117610339565b565b600080548190819074010000000000000000000000000000000000000000900460ff161561014657600080fd5b61014f33610315565b151561015a57600080fd5b600160a060020a03841660009081526004602052604090205460ff161561018057600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156101c157600080fd5b505af11580156101d5573d6000803e3d6000fd5b505050506040513d60208110156101eb57600080fd5b505115156101f857600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561023657600080fd5b505af115801561024a573d6000803e3d6000fd5b505050506040513d602081101561026057600080fd5b50519150600060ff83161080159061027c575060058260ff1611155b151561028757600080fd5b61029082610400565b9050600160035460ff1660018111156102a557fe5b14156102b5576064600a82020490505b600160a060020a038085166000908152600460205260409020805460ff19166001908117909155546102ef9116858363ffffffff6104b216565b50505050565b6102fe33610315565b151561030957600080fd5b61031281610551565b50565b600061032860028363ffffffff61056216565b90505b919050565b61011733610599565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561039e57600080fd5b505af11580156103b2573d6000803e3d6000fd5b505050506040513d60208110156103c857600080fd5b5051905060008111156103f8576000546001546103f891600160a060020a0391821691168363ffffffff6104b216565b6103126105aa565b600060ff8216151561041d575069152d02c7e14af680000061032b565b8160ff166001141561043a575069d3c21bcecceda100000061032b565b8160ff166002141561045857506a01a784379d99db4200000061032b565b8160ff166003141561047657506a027b46536c66c8e300000061032b565b8160ff166004141561049457506a034f086f3b33b68400000061032b565b8160ff166005141561032b57506a0422ca8b0a00a42500000061032b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561051557600080fd5b505af1158015610529573d6000803e3d6000fd5b505050506040513d602081101561053f57600080fd5b5051151561054c57600080fd5b505050565b61031260028263ffffffff6105e116565b6000600160a060020a038216151561057957600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61031260028263ffffffff61062f16565b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a03811615156105f657600080fd5b6106008282610562565b1561060a57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561064457600080fd5b61064e8282610562565b151561065957600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a723058208317cc38f72fdbf4d19029db12a6c784275ab5dfd7521863b2c79aee26e6effb0029",
"functionHashes": {
"CAT_0_VALUE()": "9fc3c983",
"CAT_1_VALUE()": "492fba84",
"CAT_2_VALUE()": "aed6183f",
"CAT_3_VALUE()": "49dc9ed0",
"CAT_4_VALUE()": "455acbcd",
"CAT_5_VALUE()": "a89febb2",
"TOKEN_FACTOR()": "25109e8b",
"addCoreTeam(address)": "2e6b6849",
"isCoreTeam(address)": "608d3d3d",
"renounceCoreTeam()": "d43acc79",
@@ -196,18 +91,11 @@
},
"gasEstimates": {
"creation": {
"codeDepositCost": "401400",
"codeDepositCost": "340600",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"CAT_0_VALUE()": "423",
"CAT_1_VALUE()": "357",
"CAT_2_VALUE()": "467",
"CAT_3_VALUE()": "379",
"CAT_4_VALUE()": "335",
"CAT_5_VALUE()": "445",
"TOKEN_FACTOR()": "291",
"addCoreTeam(address)": "infinite",
"isCoreTeam(address)": "infinite",
"renounceCoreTeam()": "infinite",
@@ -370,9 +370,9 @@
}
},
"spdx-correct": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz",
"integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
"integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
"requires": {
"spdx-expression-parse": "^3.0.0",
"spdx-license-ids": "^3.0.0"
@@ -399,7 +399,7 @@
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"requires": {
"code-point-at": "^1.0.0",
@@ -9,7 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"openzeppelin-solidity": "^2.0.0",
"solc": "^0.4.24"
"openzeppelin-solidity": "2.0.0",
"solc": "0.4.24"
}
}
@@ -37,16 +37,18 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
// Create some miners...
var minerAccounts = new IAccount[3];
var referralAccounts = new IAccount[3];
AlgoMiner[] miners = new AlgoMiner[3];
for (int i = 0; i < 3; i++)
{
// Create an account for the miner...
// Create an account for the miner and the referral...
minerAccounts[i] = EthAccountFactory.Create();
referralAccounts[i] = EthAccountFactory.Create();
// Create the miner...
miners[i] = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await miners[i].DeployAsync(1, 2, minerAccounts[i].Address, token.ContractAddress);
await miners[i].DeployAsync(0, 2, minerAccounts[i].Address, referralAccounts[i].Address, token.ContractAddress);
}
// Register a miner...
@@ -115,6 +117,16 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
await token.DeployAsync();
// Create the pools to transfer the proper number of tokens to the miners...
var pool1 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await pool1.DeployAsync(0, token.ContractAddress);
var pool2 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await pool2.DeployAsync(1, token.ContractAddress);
// Transfer some tokens to the pools...
await token.TransferAsync(pool1.ContractAddress, 100.MAlgo());
await token.TransferAsync(pool2.ContractAddress, 100.MAlgo());
// Create a fees...
var fees1 = new AlgoFees(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await fees1.DeployAsync(token.ContractAddress);
@@ -127,20 +139,23 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
// Create one miner per category...
var minerAccounts = new IAccount[6];
var referralAccounts = new IAccount[6];
var miners = new AlgoMiner[6];
for (byte i = 0; i <= 5; i++)
{
// Create an account for the miner...
// Create an account for the miner and the referral...
minerAccounts[i] = EthAccountFactory.Create();
referralAccounts[i] = EthAccountFactory.Create();
await EthNetwork.Instance.RefillAsync(minerAccounts[i]);
// Create the miner...
miners[i] = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await miners[i].DeployAsync(1, i, minerAccounts[i].Address, token.ContractAddress);
await miners[i].DeployAsync(0, i, minerAccounts[i].Address, referralAccounts[i].Address, token.ContractAddress);
// Transfer some tokens to the miner so it can be activated...
await token.TransferAsync(miners[i].ContractAddress, 100.Algo());
await pool1.TrasferToMinerAsync(miners[i].ContractAddress);
await pool2.TrasferToMinerAsync(miners[i].ContractAddress);
// Activate the miner...
await miners[i].ActivateMinerAsync();
@@ -13,10 +13,8 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
{
public class AlgoMinerTests
{
private const long INITIAL_SUPPLY = 1000000000;
[Fact]
public async Task BasicMinerWorkfloWTest()
public async Task PoolBasedMinerBasicWorkfloWTest()
{
EthNetwork.UseGanacheTestNet();
@@ -27,6 +25,7 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
var coreTeamAccount = EthAccountFactory.Create();
var supervisorAccount = EthAccountFactory.Create();
var minerAccount = EthAccountFactory.Create();
var referralAccount = EthAccountFactory.Create();
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
await EthNetwork.Instance.RefillAsync(systemAccount);
@@ -38,17 +37,19 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
await token.DeployAsync();
// Create a pool...
// Create the pools to transfer the proper number of tokens to the miners...
var pool1 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await pool1.DeployAsync(0, token.ContractAddress);
var pool2 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await pool2.DeployAsync(1, token.ContractAddress);
await pool1.DeployAsync(10, token.ContractAddress);
// Transfer some tokens to the pool...
// Transfer some tokens to the pools...
await token.TransferAsync(pool1.ContractAddress, 100.MAlgo());
await token.TransferAsync(pool2.ContractAddress, 100.MAlgo());
// Create a miner category 2...
var miner1 = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await miner1.DeployAsync(5, 2, minerAccount.Address, token.ContractAddress);
await miner1.DeployAsync(0, 2, minerAccount.Address, referralAccount.Address, token.ContractAddress);
// Add roles to the miner...
await miner1.AddSystemAsync(systemAccount.Address);
@@ -56,9 +57,10 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
// Transfer tokens to the miner...
await pool1.TrasferToMinerAsync(miner1.ContractAddress);
await pool2.TrasferToMinerAsync(miner1.ContractAddress);
// Ensure the miner received the tokens according to its category 2.
Assert.Equal(2.MAlgo(), await token.BalanceOfAsync(miner1.ContractAddress));
Assert.Equal(2.MAlgo() + 2.MAlgo() * 10 / 100, await token.BalanceOfAsync(miner1.ContractAddress));
// Activate the miner...
await miner1.ActivateMinerAsync();
@@ -72,13 +74,16 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
var paymentPerDay = 2.MAlgo() / 2 / 365;
BigInteger expectedMinerBalance = 0;
BigInteger expectedReferralBalance = 0;
for (int i = 0; i < 5; i++)
{
await miner1.MineAsync();
expectedMinerBalance += paymentPerDay;
expectedReferralBalance += paymentPerDay * 10 / 100;
Assert.Equal(expectedMinerBalance, await token.BalanceOfAsync(minerAccount.Address));
Assert.Equal(expectedReferralBalance, await token.BalanceOfAsync(referralAccount.Address));
}
// Pause the miner...
@@ -101,8 +106,10 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
miner1.Bind(EthNetwork.Instance.GetWeb3(coreTeamAccount));
await miner1.MineAsync();
expectedMinerBalance += paymentPerDay;
expectedReferralBalance += paymentPerDay * 10 / 100;
Assert.Equal(expectedMinerBalance, await token.BalanceOfAsync(minerAccount.Address));
Assert.Equal(expectedReferralBalance, await token.BalanceOfAsync(referralAccount.Address));
}
}
}
@@ -15,7 +15,7 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
public class AlgoPoolTests
{
[Fact]
public async Task TransferToMinerTest()
public async Task MinerPoolTransferToMinerTest()
{
EthNetwork.UseGanacheTestNet();
@@ -24,6 +24,7 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
var tokenOwnerAccount = EthAccountFactory.Create();
var coreTeamAccount = EthAccountFactory.Create();
var minerAccounts = new IAccount[6];
var referralAccounts = new IAccount[6];
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
@@ -34,7 +35,7 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
// Create a pool...
var pool1 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await pool1.DeployAsync(10, token.ContractAddress);
await pool1.DeployAsync(0, token.ContractAddress);
// Transfer some tokens to the pool...
await token.TransferAsync(pool1.ContractAddress, 100.MAlgo());
@@ -42,14 +43,15 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
// Create miners for each category...
AlgoMiner[] miners = new AlgoMiner[6];
for (int i = 0; i <= 5; i++)
for (byte i = 0; i <= 5; i++)
{
// Create an account for the miner...
// Create an account for the miner and the referral...
minerAccounts[i] = EthAccountFactory.Create();
referralAccounts[i] = EthAccountFactory.Create();
// Create the miner...
miners[i] = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await miners[i].DeployAsync((ushort)i, (byte)i, minerAccounts[i].Address, token.ContractAddress);
await miners[i].DeployAsync(0, i, minerAccounts[i].Address, referralAccounts[i].Address, token.ContractAddress);
}
// Transfer tokens from the pool to the miners...
@@ -66,5 +68,60 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
Assert.Equal(4.MAlgo(), await token.BalanceOfAsync(miners[4].ContractAddress));
Assert.Equal(5.MAlgo(), await token.BalanceOfAsync(miners[5].ContractAddress));
}
[Fact]
public async Task ReferralPoolTransferToMinerTest()
{
EthNetwork.UseGanacheTestNet();
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
var tokenOwnerAccount = EthAccountFactory.Create();
var coreTeamAccount = EthAccountFactory.Create();
var minerAccounts = new IAccount[6];
var referralAccounts = new IAccount[6];
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
// Create the ERC20 token...
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
await token.DeployAsync();
// Create a pool...
var pool1 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await pool1.DeployAsync(1, token.ContractAddress);
// Transfer some tokens to the pool...
await token.TransferAsync(pool1.ContractAddress, 100.MAlgo());
// Create miners for each category...
AlgoMiner[] miners = new AlgoMiner[6];
for (byte i = 0; i <= 5; i++)
{
// Create an account for the miner and the referral...
minerAccounts[i] = EthAccountFactory.Create();
referralAccounts[i] = EthAccountFactory.Create();
// Create the miner...
miners[i] = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
await miners[i].DeployAsync(0, i, minerAccounts[i].Address, referralAccounts[i].Address, token.ContractAddress);
}
// Transfer tokens from the pool to the miners...
for (int i = 0; i <= 5; i++)
{
await pool1.TrasferToMinerAsync(miners[i].ContractAddress);
}
// Ensure each miner received the proper amount of tokens according its category...
Assert.Equal(100000.Algo() * 10 / 100, await token.BalanceOfAsync(miners[0].ContractAddress));
Assert.Equal(1.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[1].ContractAddress));
Assert.Equal(2.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[2].ContractAddress));
Assert.Equal(3.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[3].ContractAddress));
Assert.Equal(4.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[4].ContractAddress));
Assert.Equal(5.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[5].ContractAddress));
}
}
}
+9 -7
View File
@@ -200,10 +200,10 @@ The following commands are supported for the `AlgoPool` contract:
`deploy-algopool <poolType> <tokenAddress> [-n <contract_name>]`
Creates a new instance of the `AlgoPool` contract.
* `poolType`: the type of pool (uint16)
* `poolType`: the type of pool (uint8: 0 = PoolType, 1 = ReferralPool)
* `tokenAddress`: the address of the AlgoToken contract
>Example: `deploy-algopool 1 token -n dev_pool`
>Example: `deploy-algopool 0 token -n dev_pool`
#### algopool-trasfertominer
@@ -220,15 +220,16 @@ The following commands are supported for the `AlgoMiner` contract:
#### deploy-algominer
`deploy-algominer <minerType> <category> <minerAccountAddress> <tokenAddress> [-n <contract_name>]`
`deploy-algominer <minerType> <category> <minerAccountAddress> <referralAccountAddress> <tokenAddress> [-n <contract_name>]`
Creates a new instance of the `AlgoPool` contract.
* `minerType`: the type of miner (uint16)
* `minerType`: the type of miner (uint8: 0 = PoolBased, 1 = NonPoolBased)
* `category`: the category of miner (uint8: valid from 0 to 5)
* `minerAccountAddress`: the address of the miner's owner
* `referralAccountAddress`: the address of the referral
* `tokenAddress`: the address of the AlgoToken contract
>Example: `deploy-algominer 1 2 miner_1_account token -n miner_1`
>Example: `deploy-algominer 0 2 miner_1_account referral_1_account token -n miner_1`
#### algominer-activateminer
@@ -275,16 +276,17 @@ Resumes the miner.
`<contract>.algominer-stopandremoveownership`
Sets the miner to the stopped state and remove the ownership, a new owner will be assigned using the `resetMiner` operation.
Sets the miner to the stopped state and remove the ownership, a new owner and referral will be assigned using the `resetMiner` operation.
>Example: `miner_1.algominer-stopandremoveownership`
#### algominer-resetminer
`<contract>.algominer-resetminer <newOwnerAddress>`
`<contract>.algominer-resetminer <newOwnerAddress> <newReferralAddress>`
Resets the miner.
* `newOwnerAddress`: the address of the new owner
* `newReferralAddress`: the address of the new referral
>Example: `miner_1.algominer-resetminer`
@@ -1,9 +1,15 @@
new-account -n miner_0_account
new-account -n ref_0_account
new-account -n miner_1_account
new-account -n ref_1_account
new-account -n miner_2_account
new-account -n ref_2_account
new-account -n miner_3_account
new-account -n ref_3_account
new-account -n miner_4_account
new-account -n ref_4_account
new-account -n miner_5_account
new-account -n ref_5_account
import-account 0936af475d2701538aad321f87e0a51f2b297634653393e8cab7290a674009a5 -n prefunded
eth-transfer miner_0_account 1eth
eth-transfer miner_1_account 1eth
@@ -12,18 +18,28 @@ eth-transfer miner_3_account 1eth
eth-transfer miner_4_account 1eth
eth-transfer miner_5_account 1eth
deploy-algotoken -n token
deploy-algominer 1 0 miner_0_account token -n miner_0
deploy-algominer 1 1 miner_1_account token -n miner_1
deploy-algominer 1 2 miner_2_account token -n miner_2
deploy-algominer 1 3 miner_3_account token -n miner_3
deploy-algominer 1 4 miner_4_account token -n miner_4
deploy-algominer 1 5 miner_5_account token -n miner_5
token.algotoken-transfer miner_0 1m
token.algotoken-transfer miner_1 1m
token.algotoken-transfer miner_2 1m
token.algotoken-transfer miner_3 1m
token.algotoken-transfer miner_4 1m
token.algotoken-transfer miner_5 1m
deploy-algominer 1 0 miner_0_account ref_0_account token -n miner_0
deploy-algominer 1 1 miner_1_account ref_1_account token -n miner_1
deploy-algominer 1 2 miner_2_account ref_2_account token -n miner_2
deploy-algominer 1 3 miner_3_account ref_3_account token -n miner_3
deploy-algominer 1 4 miner_4_account ref_4_account token -n miner_4
deploy-algominer 1 5 miner_5_account ref_5_account token -n miner_5
deploy-algopool 0 token -n dev_pool
deploy-algopool 1 token -n ref_pool
token.algotoken-transfer dev_pool 100m
token.algotoken-transfer ref_pool 100m
dev_pool.algopool-trasfertominer miner_0
ref_pool.algopool-trasfertominer miner_0
dev_pool.algopool-trasfertominer miner_1
ref_pool.algopool-trasfertominer miner_1
dev_pool.algopool-trasfertominer miner_2
ref_pool.algopool-trasfertominer miner_2
dev_pool.algopool-trasfertominer miner_3
ref_pool.algopool-trasfertominer miner_3
dev_pool.algopool-trasfertominer miner_4
ref_pool.algopool-trasfertominer miner_4
dev_pool.algopool-trasfertominer miner_5
ref_pool.algopool-trasfertominer miner_5
miner_0.algominer-activateminer
miner_1.algominer-activateminer
miner_2.algominer-activateminer
@@ -1,13 +1,18 @@
new-account -n miner_1_account
new-account -n ref_1_account
import-account 0936af475d2701538aad321f87e0a51f2b297634653393e8cab7290a674009a5 -n prefunded
eth-transfer miner_1_account 1eth
eth-getbalance miner_1_account
deploy-algotoken -n token
deploy-algopool 1 token -n dev_pool
deploy-algopool 0 token -n dev_pool
deploy-algopool 1 token -n ref_pool
token.algotoken-transfer dev_pool 100m
token.algotoken-transfer ref_pool 100m
token.algotoken-balanceof dev_pool
deploy-algominer 1 2 miner_1_account token -n miner_1
token.algotoken-balanceof ref_pool
deploy-algominer 0 2 miner_1_account ref_1_account token -n miner_1
dev_pool.algopool-trasfertominer miner_1
ref_pool.algopool-trasfertominer miner_1
token.algotoken-balanceof miner_1
miner_1.algominer-activateminer
set-account miner_1_account
@@ -15,5 +20,7 @@ miner_1.algominer-startmining
set-account prefunded
miner_1.algominer-mine
token.algotoken-balanceof miner_1_account
token.algotoken-balanceof ref_1_account
miner_1.algominer-mine
token.algotoken-balanceof miner_1_account
token.algotoken-balanceof ref_1_account
@@ -14,9 +14,10 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
{
public override string DefaultName => "AlgoMiner";
public ushort MinerType { get; set; }
public byte MinerType { get; set; }
public byte Category { get; set; }
public string MinerAccountAddress { get; set; }
public string ReferralAccountAddress { get; set; }
public string TokenAddress { get; set; }
protected override async Task<TransactionReceipt> DeployContractAsync(RuntimeContext context, Web3 web3)
@@ -26,6 +27,7 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
MinerType,
Category,
context.ResolveAccountReference(MinerAccountAddress),
context.ResolveAccountReference(ReferralAccountAddress),
context.ResolveContractReference(TokenAddress));
}
}
@@ -14,12 +14,15 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
public class AlgoMinerResetMinerCommand : EthInvokeTransactionalFunctionCommand
{
public string NewOwnerAddress { get; set; }
public string NewReferralAddress { get; set; }
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
{
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
return await algoMiner.ResetMinerAsync(context.ResolveAccountReference(NewOwnerAddress));
return await algoMiner.ResetMinerAsync(
context.ResolveAccountReference(NewOwnerAddress),
context.ResolveAccountReference(NewReferralAddress));
}
}
}
@@ -14,7 +14,7 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoPoolContract
{
public override string DefaultName => "AlgoPool";
public ushort PoolType { get; set; }
public byte PoolType { get; set; }
public string TokenAddress { get; set; }
protected override async Task<TransactionReceipt> DeployContractAsync(RuntimeContext context, Web3 web3)
@@ -11,17 +11,19 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Parsers
public static void Register()
{
(from command in CommonParsers.Token("deploy-algominer")
from minerType in CommonParsers.IntegerValue
from category in CommonParsers.IntegerValue
from minerType in CommonParsers.ByteValue
from category in CommonParsers.ByteValue
from minerAccountAddress in CommonParsers.StringValue
from referralAccountAddress in CommonParsers.StringValue
from tokenAddress in CommonParsers.StringValue
from name in CommonParsers.Switch('n', "name", CommonParsers.Identifier).Optional()
select new AlgoMinerDeployCommand
{
Name = name.GetOrDefault(),
MinerType = (ushort)minerType,
Category = (byte)category,
MinerType = minerType,
Category = category,
MinerAccountAddress = minerAccountAddress,
ReferralAccountAddress = referralAccountAddress,
TokenAddress = tokenAddress
}).Register();
@@ -65,10 +67,12 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Parsers
(from contractReference in CommonParsers.Invoke("algominer-resetminer")
from newOwnerAddress in CommonParsers.StringValue
from newReferralAddress in CommonParsers.StringValue
select new AlgoMinerResetMinerCommand
{
ContractReference = contractReference,
NewOwnerAddress = newOwnerAddress
NewOwnerAddress = newOwnerAddress,
NewReferralAddress = newReferralAddress
}).Register();
(from contractReference in CommonParsers.Invoke("algominer-startmining")
@@ -11,13 +11,13 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Parsers
public static void Register()
{
(from command in CommonParsers.Token("deploy-algopool")
from poolType in CommonParsers.IntegerValue
from poolType in CommonParsers.ByteValue
from tokenAddress in CommonParsers.StringValue
from name in CommonParsers.Switch('n', "name", CommonParsers.Identifier).Optional()
select new AlgoPoolDeployCommand
{
Name = name.GetOrDefault(),
PoolType = (ushort)poolType,
PoolType = poolType,
TokenAddress = tokenAddress
}).Register();
@@ -24,6 +24,9 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Parsers
from close in Parse.Char('"')
select content;
public static readonly Parser<byte> ByteValue =
Integer.Select(x => byte.Parse(x, CultureInfo.InvariantCulture));
public static readonly Parser<int> IntegerValue =
Integer.Select(x => int.Parse(x, CultureInfo.InvariantCulture));
@@ -18,6 +18,8 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime
public string ResolveAccountReference(string reference)
{
if (string.IsNullOrWhiteSpace(reference) || string.Equals(reference, "0x0", StringComparison.OrdinalIgnoreCase)) return "0x0";
if (TryResolveAccountReference(reference, out string address)) return address;
throw new Exception($"Invalid account name or address: '{reference}'.");