Merge pull request #5 from GrupoSabra/master

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. Fixed build scripts. Added "terminate" function to all contracts.
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2018-12-18 18:13:57 +01:00
commit 9ae2289a3b
41 files changed
+27032 -19231

No files matched your search

@@ -27,7 +27,7 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution
protected override string AbiResourceName => $"SmartContracts.src.bin.{nameof(AlgoFees)}.abi";
protected override string BinResourceName => $"SmartContracts.src.bin.{nameof(AlgoFees)}.bin";
protected override BigInteger DeploymentGasUnits => 1200000;
protected override BigInteger DeploymentGasUnits => 1400000;
public Task<TransactionReceipt> DeployAsync(string tokenAddress)
=> base.DeployAsync(tokenAddress);
@@ -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 => 1200000;
protected override BigInteger DeploymentGasUnits => 1600000;
public Task<TransactionReceipt> DeployAsync(ushort minerType, byte category, string ownerAddress, string tokenAddress)
=> base.DeployAsync(minerType, category, ownerAddress, 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,10 +4,11 @@ import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "./IAlgoMiner.sol";
import "./ERC20TokenHolder.sol";
import "./AlgoSystemRole.sol";
import "./AlgoCoreTeamRole.sol";
contract AlgoFees is AlgoSystemRole, AlgoCoreTeamRole {
contract AlgoFees is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole {
using SafeERC20 for IERC20;
uint256 constant CAT_0_VALUE_PROPORTION = 1;
@@ -17,19 +18,19 @@ contract AlgoFees is AlgoSystemRole, AlgoCoreTeamRole {
uint256 constant CAT_4_VALUE_PROPORTION = 40;
uint256 constant CAT_5_VALUE_PROPORTION = 50;
IERC20 private _token;
address[] private _miners;
mapping(address => uint256) private _minersByAddress;
constructor(address tokenAddress)
ERC20TokenHolder(tokenAddress)
AlgoSystemRole()
AlgoCoreTeamRole()
public {
_token = IERC20(tokenAddress);
_miners.push(address(0)); // Reserved as a marker for unregistered miner.
}
function registerMiner(address minerAddress) public onlyCoreTeam {
function registerMiner(address minerAddress) public notTerminated onlyCoreTeam {
require(_miners.length < 1000);
require(_minersByAddress[minerAddress] == 0);
IAlgoMiner algoMiner = IAlgoMiner(minerAddress);
@@ -44,7 +45,7 @@ contract AlgoFees is AlgoSystemRole, AlgoCoreTeamRole {
_miners.push(minerAddress);
}
function unregisterMiner(address minerAddress) public onlyCoreTeam {
function unregisterMiner(address minerAddress) public notTerminated onlyCoreTeam {
require(_miners.length > 1);
if(_miners.length == 2) {
@@ -67,7 +68,7 @@ contract AlgoFees is AlgoSystemRole, AlgoCoreTeamRole {
}
}
function mine() public onlySystem {
function mine() public notTerminated onlySystem {
require(_miners.length > 1);
uint256 currentFeesBalance = _token.balanceOf(address(this));
@@ -128,6 +129,10 @@ contract AlgoFees is AlgoSystemRole, AlgoCoreTeamRole {
}
}
function terminate() public onlyCoreTeam {
_terminate();
}
function getMinerCount() public view returns (uint256) {
return _miners.length - 1;
}
@@ -4,15 +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 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,
@@ -20,10 +27,10 @@ contract AlgoMiner is AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlg
Stopped
}
uint16 private _minerType;
MinerType private _minerType;
uint8 private _category;
address private _miner;
IERC20 private _token;
address private _referral;
MinerState private _state;
bool private _mining;
@@ -31,7 +38,8 @@ contract AlgoMiner is AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlg
uint16 private _currentDay;
uint256 private _currentYearSupply;
constructor(uint16 minerType, uint8 category, address ownerAddress, address tokenAddress)
constructor(MinerType minerType, uint8 category, address minerAccountAddress, address referralAccountAddress, address tokenAddress)
ERC20TokenHolder(tokenAddress)
AlgoSystemRole()
AlgoCoreTeamRole()
AlgoSupervisorRole()
@@ -41,8 +49,8 @@ contract AlgoMiner is AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlg
_minerType = minerType;
_category = category;
_miner = ownerAddress;
_token = IERC20(tokenAddress);
_miner = minerAccountAddress;
_referral = referralAccountAddress;
}
modifier onlyMiner() {
@@ -50,21 +58,25 @@ contract AlgoMiner is AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlg
_;
}
function activateMiner() public onlyCoreTeam {
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;
}
function deactivateMiner() public onlyCoreTeam {
function deactivateMiner() public notTerminated onlyCoreTeam {
require(_state != MinerState.Deactivated);
_state = MinerState.Deactivated;
@@ -77,48 +89,51 @@ contract AlgoMiner is AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlg
_token.safeTransfer(newMinerAddress, _token.balanceOf(address(this)));
}
function pauseMining() public onlySupervisor {
function pauseMining() public notTerminated onlySupervisor {
require(_state == MinerState.Activated);
_state = MinerState.Suspended;
}
function resumeMining() public onlySupervisor {
function resumeMining() public notTerminated onlySupervisor {
require(_state == MinerState.Suspended);
_state = MinerState.Activated;
}
function stopAndRemoveOwnership() public onlySupervisor {
function stopAndRemoveOwnership() public notTerminated onlySupervisor {
require(_state != MinerState.Stopped);
_state = MinerState.Stopped;
_mining = false;
_miner = address(0);
_referral = address(0);
}
function resetMiner(address newOwnerAddress) public onlySupervisor {
function resetMiner(address newOwnerAddress, address newReferralAddress) public notTerminated onlySupervisor {
require(_state == MinerState.Stopped);
_state = MinerState.Activated;
_miner = newOwnerAddress;
_referral = newReferralAddress;
}
function startMining() public onlyMiner {
function startMining() public notTerminated onlyMiner {
require(_state == MinerState.Activated);
require(!_mining);
_mining = true;
}
function stopMining() public onlyMiner {
function stopMining() public notTerminated onlyMiner {
require(_state == MinerState.Activated);
require(_mining);
_mining = false;
}
function mine() public onlySystem {
function mine() public notTerminated onlySystem {
require(_minerType == MinerType.PoolBased);
require(_state == MinerState.Activated);
require(_mining);
@@ -134,26 +149,58 @@ contract AlgoMiner is AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlg
}
}
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 {
_terminate();
}
function isAlgoMiner() public pure returns (bool) {
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,31 +4,29 @@ 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 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;
IERC20 private _token;
PoolType private _poolType;
mapping(address => bool) _fundedMiners;
constructor(uint16 poolType, address tokenAddress)
constructor(PoolType poolType, address tokenAddress)
ERC20TokenHolder(tokenAddress)
AlgoCoreTeamRole()
public {
_poolType = poolType;
_token = IERC20(tokenAddress);
}
function trasferToMiner(address minerAddress) public onlyCoreTeam {
function trasferToMiner(address minerAddress) public notTerminated onlyCoreTeam {
require(!_fundedMiners[minerAddress]);
IAlgoMiner algoMiner = IAlgoMiner(minerAddress);
@@ -39,25 +37,18 @@ contract AlgoPool is 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);
}
function terminate() public onlyCoreTeam {
_terminate();
}
}
@@ -0,0 +1,24 @@
pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "./Terminable.sol";
contract ERC20TokenHolder is Terminable {
using SafeERC20 for IERC20;
IERC20 internal _token;
constructor(address tokenAddress) Terminable() internal {
_token = IERC20(tokenAddress);
}
function _terminate() internal {
uint256 currentBalance = _token.balanceOf(address(this));
if(currentBalance > 0) {
_token.safeTransfer(_creator, currentBalance);
}
Terminable._terminate();
}
}
@@ -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);
@@ -0,0 +1,21 @@
pragma solidity 0.4.24;
contract Terminable {
address internal _creator;
bool internal _terminated;
constructor() internal {
_creator = msg.sender;
_terminated = false;
}
modifier notTerminated() {
require(!_terminated);
_;
}
function _terminate() internal {
_terminated = true;
}
}
@@ -1 +1 @@
[{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"registerMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSystem","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getMinerByIndex","outputs":[{"name":"","type":"address"}],"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":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"unregisterMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"mine","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMinerCount","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":"renounceSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"registerMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSystem","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getMinerByIndex","outputs":[{"name":"","type":"address"}],"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":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"unregisterMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"mine","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMinerCount","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":"renounceSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
@@ -1 +1 @@
608060405234801561001057600080fd5b50604051602080610edc8339810160405251610034336401000000006100a2810204565b610046336401000000006100bd810204565b60028054600160a060020a03909216600160a060020a0319928316179055600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180549091169055610163565b6100ba600082640100000000610c436100d582021704565b50565b6100ba600182640100000000610c436100d582021704565b600160a060020a03811615156100ea57600080fd5b6100fd828264010000000061012c810204565b1561010757600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561014357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610d6a806101726000396000f3006080604052600436106100955763ffffffff60e060020a6000350416632e6b6849811461009a578063341ccfcb146100bd57806334cdcf26146100de5780633d19ab1314610113578063608d3d3d1461014757806374be75921461016857806381f909f31461018957806399f4b251146101aa578063bb52c137146101bf578063d43acc79146101e6578063e9d61859146101fb575b600080fd5b3480156100a657600080fd5b506100bb600160a060020a0360043516610210565b005b3480156100c957600080fd5b506100bb600160a060020a0360043516610230565b3480156100ea57600080fd5b506100ff600160a060020a03600435166103e1565b604080519115158252519081900360200190f35b34801561011f57600080fd5b5061012b6004356103f9565b60408051600160a060020a039092168252519081900360200190f35b34801561015357600080fd5b506100ff600160a060020a0360043516610428565b34801561017457600080fd5b506100bb600160a060020a036004351661043b565b34801561019557600080fd5b506100bb600160a060020a0360043516610458565b3480156101b657600080fd5b506100bb6105e7565b3480156101cb57600080fd5b506101d4610b0a565b60408051918252519081900360200190f35b3480156101f257600080fd5b506100bb610b15565b34801561020757600080fd5b506100bb610b20565b61021933610428565b151561022457600080fd5b61022d81610b29565b50565b60008061023c33610428565b151561024757600080fd5b600160a060020a0383166000908152600460205260409020541561026a57600080fd5b82915081600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156102ab57600080fd5b505af11580156102bf573d6000803e3d6000fd5b505050506040513d60208110156102d557600080fd5b505115156102e257600080fd5b81600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032057600080fd5b505af1158015610334573d6000803e3d6000fd5b505050506040513d602081101561034a57600080fd5b50519050600060ff821610801590610366575060058160ff1611155b151561037157600080fd5b505060038054600160a060020a039092166000818152600460205260408120849055600184018355919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b60006103f3818363ffffffff610b3a16565b92915050565b600060038260010181548110151561040d57fe5b600091825260209091200154600160a060020a031692915050565b60006103f360018363ffffffff610b3a16565b610444336103e1565b151561044f57600080fd5b61022d81610b71565b61046133610428565b151561046c57600080fd5b60035460011061047b57600080fd5b600354600214156104e75760038054600190811061049557fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916905560016104c8600382610cdd565b50600160a060020a03811660009081526004602052604081205561022d565b600354600160a060020a038216600090815260046020526040902054146105815760038054600019810190811061051a57fe5b6000918252602080832090910154600160a060020a038481168452600490925260409092205460038054929093169291811061055257fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b60038054600019810190811061059357fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916905560038054906105cc906000198301610cdd565b50600160a060020a0316600090815260046020526040812055565b60006105f1610d01565b6000806000806105ff610d01565b610608336103e1565b151561061357600080fd5b60035460011061062257600080fd5b600254604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561068857600080fd5b505af115801561069c573d6000803e3d6000fd5b505050506040513d60208110156106b257600080fd5b50519650600087116106c357600080fd5b600194505b6003548510156108725760038054869081106106e057fe5b9060005260206000200160009054906101000a9004600160a060020a0316935083600160a060020a03166319a74ab36040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561073e57600080fd5b505af1158015610752573d6000803e3d6000fd5b505050506040513d602081101561076857600080fd5b5051151561077557610867565b83600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156107b357600080fd5b505af11580156107c7573d6000803e3d6000fd5b505050506040513d60208110156107dd57600080fd5b5051925060ff831615156107ff578560005b6020020180516001019052610867565b8260ff1660011415610813578560016107ef565b8260ff1660021415610827578560026107ef565b8260ff166003141561083b578560036107ef565b8260ff166004141561084f578560046107ef565b826Line truncated
60806040523480156200001157600080fd5b50604051602080620010d083398101604052516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790556200006c90640100000000620000c7810204565b6200008033640100000000620000e5810204565b50600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a031916905562000193565b620000e260028264010000000062000e066200010082021704565b50565b620000e260038264010000000062000e066200010082021704565b600160a060020a03811615156200011657600080fd5b6200012b82826401000000006200015b810204565b156200013657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200017357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610f2d80620001a36000396000f3006080604052600436106100a05763ffffffff60e060020a6000350416630c08bf8881146100a55780632e6b6849146100bc578063341ccfcb146100dd57806334cdcf26146100fe5780633d19ab1314610133578063608d3d3d1461016757806374be75921461018857806381f909f3146101a957806399f4b251146101ca578063bb52c137146101df578063d43acc7914610206578063e9d618591461021b575b600080fd5b3480156100b157600080fd5b506100ba610230565b005b3480156100c857600080fd5b506100ba600160a060020a036004351661024e565b3480156100e957600080fd5b506100ba600160a060020a036004351661026e565b34801561010a57600080fd5b5061011f600160a060020a0360043516610457565b604080519115158252519081900360200190f35b34801561013f57600080fd5b5061014b600435610470565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b5061011f600160a060020a036004351661049f565b34801561019457600080fd5b506100ba600160a060020a03600435166104b2565b3480156101b557600080fd5b506100ba600160a060020a03600435166104cf565b3480156101d657600080fd5b506100ba610686565b3480156101eb57600080fd5b506101f4610bd1565b60408051918252519081900360200190f35b34801561021257600080fd5b506100ba610bdc565b34801561022757600080fd5b506100ba610be5565b6102393361049f565b151561024457600080fd5b61024c610bee565b565b6102573361049f565b151561026257600080fd5b61026b81610cb5565b50565b60008054819074010000000000000000000000000000000000000000900460ff161561029957600080fd5b6102a23361049f565b15156102ad57600080fd5b6004546103e8116102bd57600080fd5b600160a060020a038316600090815260056020526040902054156102e057600080fd5b82915081600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032157600080fd5b505af1158015610335573d6000803e3d6000fd5b505050506040513d602081101561034b57600080fd5b5051151561035857600080fd5b81600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561039657600080fd5b505af11580156103aa573d6000803e3d6000fd5b505050506040513d60208110156103c057600080fd5b50519050600060ff8216108015906103dc575060058160ff1611155b15156103e757600080fd5b505060048054600160a060020a039092166000818152600560205260408120849055600184018355919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b600061046a60028363ffffffff610cc616565b92915050565b600060048260010181548110151561048457fe5b600091825260209091200154600160a060020a031692915050565b600061046a60038363ffffffff610cc616565b6104bb33610457565b15156104c657600080fd5b61026b81610cfd565b60005474010000000000000000000000000000000000000000900460ff16156104f757600080fd5b6105003361049f565b151561050b57600080fd5b60045460011061051a57600080fd5b600454600214156105865760048054600190811061053457fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191690556001610567600482610ea0565b50600160a060020a03811660009081526005602052604081205561026b565b600454600160a060020a03821660009081526005602052604090205414610620576004805460001981019081106105b957fe5b6000918252602080832090910154600160a060020a03848116845260059092526040909220546004805492909316929181106105f157fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b60048054600019810190811061063257fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055600480549061066b906000198301610ea0565b50600160a060020a0316600090815260056020526040812055565b6000610690610ec4565b60008060008061069e610ec4565b60005474010000000000000000000000000000000000000000900460ff16156106c657600080fd5b6106cf33610457565b15156106da57600080fd5b6004546001106106e957600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561074f57600080fd5b505af1158015610763573d6000803e3d6000fd5b505050506040513d602081101561077957600080fd5b505196506000871161078a57600080fd5b600194505b6004548510156109395760048054869081106107a757fe5b9060005260206000200160009054906101000a9004600160a060020a0316935083600160a060020a03166319a74ab36040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b5050505060405Line truncated
@@ -1,5 +1,14 @@
{
"abi": [
{
"constant": false,
"inputs": [],
"name": "terminate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
@@ -166,7 +175,7 @@
"type": "constructor"
}
],
"bytecode": "608060405234801561001057600080fd5b50604051602080610edc8339810160405251610034336401000000006100a2810204565b610046336401000000006100bd810204565b60028054600160a060020a03909216600160a060020a0319928316179055600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180549091169055610163565b6100ba600082640100000000610c436100d582021704565b50565b6100ba600182640100000000610c436100d582021704565b600160a060020a03811615156100ea57600080fd5b6100fd828264010000000061012c810204565b1561010757600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561014357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610d6a806101726000396000f3006080604052600436106100955763ffffffff60e060020a6000350416632e6b6849811461009a578063341ccfcb146100bd57806334cdcf26146100de5780633d19ab1314610113578063608d3d3d1461014757806374be75921461016857806381f909f31461018957806399f4b251146101aa578063bb52c137146101bf578063d43acc79146101e6578063e9d61859146101fb575b600080fd5b3480156100a657600080fd5b506100bb600160a060020a0360043516610210565b005b3480156100c957600080fd5b506100bb600160a060020a0360043516610230565b3480156100ea57600080fd5b506100ff600160a060020a03600435166103e1565b604080519115158252519081900360200190f35b34801561011f57600080fd5b5061012b6004356103f9565b60408051600160a060020a039092168252519081900360200190f35b34801561015357600080fd5b506100ff600160a060020a0360043516610428565b34801561017457600080fd5b506100bb600160a060020a036004351661043b565b34801561019557600080fd5b506100bb600160a060020a0360043516610458565b3480156101b657600080fd5b506100bb6105e7565b3480156101cb57600080fd5b506101d4610b0a565b60408051918252519081900360200190f35b3480156101f257600080fd5b506100bb610b15565b34801561020757600080fd5b506100bb610b20565b61021933610428565b151561022457600080fd5b61022d81610b29565b50565b60008061023c33610428565b151561024757600080fd5b600160a060020a0383166000908152600460205260409020541561026a57600080fd5b82915081600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156102ab57600080fd5b505af11580156102bf573d6000803e3d6000fd5b505050506040513d60208110156102d557600080fd5b505115156102e257600080fd5b81600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032057600080fd5b505af1158015610334573d6000803e3d6000fd5b505050506040513d602081101561034a57600080fd5b50519050600060ff821610801590610366575060058160ff1611155b151561037157600080fd5b505060038054600160a060020a039092166000818152600460205260408120849055600184018355919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b60006103f3818363ffffffff610b3a16565b92915050565b600060038260010181548110151561040d57fe5b600091825260209091200154600160a060020a031692915050565b60006103f360018363ffffffff610b3a16565b610444336103e1565b151561044f57600080fd5b61022d81610b71565b61046133610428565b151561046c57600080fd5b60035460011061047b57600080fd5b600354600214156104e75760038054600190811061049557fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916905560016104c8600382610cdd565b50600160a060020a03811660009081526004602052604081205561022d565b600354600160a060020a038216600090815260046020526040902054146105815760038054600019810190811061051a57fe5b6000918252602080832090910154600160a060020a038481168452600490925260409092205460038054929093169291811061055257fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b60038054600019810190811061059357fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916905560038054906105cc906000198301610cdd565b50600160a060020a0316600090815260046020526040812055565b60006105f1610d01565b6000806000806105ff610d01565b610608336103e1565b151561061357600080fd5b60035460011061062257600080fd5b600254604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561068857600080fd5b505af115801561069c573d6000803e3d6000fd5b505050506040513d60208110156106b257600080fd5b50519650600087116106c357600080fd5b600194505b6003548510156108725760038054869081106106e057fe5b9060005260206000200160009054906101000a9004600160a060020a0316935083600160a060020a03166319a74ab36040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561073e57600080fd5b505af1158015610752573d6000803e3d6000fd5b505050506040513d602081101561076857600080fd5b5051151561077557610867565b83600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156107b357600080fd5b505af11580156107c7573d6000803e3d6000fd5b505050506040513d60208110156107dd57600080fd5b5051925060ff831615156107ff578560005b6020020180516001019052610867565b8260ff1660011415610813578560016107ef565b8260ff1660021415610827578560026107ef565b8260ff166003141561083b578560036107ef565b8260ff166004141561084f5785Line truncated
"bytecode": "60806040523480156200001157600080fd5b50604051602080620010d083398101604052516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790556200006c90640100000000620000c7810204565b6200008033640100000000620000e5810204565b50600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a031916905562000193565b620000e260028264010000000062000e066200010082021704565b50565b620000e260038264010000000062000e066200010082021704565b600160a060020a03811615156200011657600080fd5b6200012b82826401000000006200015b810204565b156200013657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200017357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610f2d80620001a36000396000f3006080604052600436106100a05763ffffffff60e060020a6000350416630c08bf8881146100a55780632e6b6849146100bc578063341ccfcb146100dd57806334cdcf26146100fe5780633d19ab1314610133578063608d3d3d1461016757806374be75921461018857806381f909f3146101a957806399f4b251146101ca578063bb52c137146101df578063d43acc7914610206578063e9d618591461021b575b600080fd5b3480156100b157600080fd5b506100ba610230565b005b3480156100c857600080fd5b506100ba600160a060020a036004351661024e565b3480156100e957600080fd5b506100ba600160a060020a036004351661026e565b34801561010a57600080fd5b5061011f600160a060020a0360043516610457565b604080519115158252519081900360200190f35b34801561013f57600080fd5b5061014b600435610470565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b5061011f600160a060020a036004351661049f565b34801561019457600080fd5b506100ba600160a060020a03600435166104b2565b3480156101b557600080fd5b506100ba600160a060020a03600435166104cf565b3480156101d657600080fd5b506100ba610686565b3480156101eb57600080fd5b506101f4610bd1565b60408051918252519081900360200190f35b34801561021257600080fd5b506100ba610bdc565b34801561022757600080fd5b506100ba610be5565b6102393361049f565b151561024457600080fd5b61024c610bee565b565b6102573361049f565b151561026257600080fd5b61026b81610cb5565b50565b60008054819074010000000000000000000000000000000000000000900460ff161561029957600080fd5b6102a23361049f565b15156102ad57600080fd5b6004546103e8116102bd57600080fd5b600160a060020a038316600090815260056020526040902054156102e057600080fd5b82915081600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561032157600080fd5b505af1158015610335573d6000803e3d6000fd5b505050506040513d602081101561034b57600080fd5b5051151561035857600080fd5b81600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561039657600080fd5b505af11580156103aa573d6000803e3d6000fd5b505050506040513d60208110156103c057600080fd5b50519050600060ff8216108015906103dc575060058160ff1611155b15156103e757600080fd5b505060048054600160a060020a039092166000818152600560205260408120849055600184018355919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b600061046a60028363ffffffff610cc616565b92915050565b600060048260010181548110151561048457fe5b600091825260209091200154600160a060020a031692915050565b600061046a60038363ffffffff610cc616565b6104bb33610457565b15156104c657600080fd5b61026b81610cfd565b60005474010000000000000000000000000000000000000000900460ff16156104f757600080fd5b6105003361049f565b151561050b57600080fd5b60045460011061051a57600080fd5b600454600214156105865760048054600190811061053457fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191690556001610567600482610ea0565b50600160a060020a03811660009081526005602052604081205561026b565b600454600160a060020a03821660009081526005602052604090205414610620576004805460001981019081106105b957fe5b6000918252602080832090910154600160a060020a03848116845260059092526040909220546004805492909316929181106105f157fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b60048054600019810190811061063257fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055600480549061066b906000198301610ea0565b50600160a060020a0316600090815260056020526040812055565b6000610690610ec4565b60008060008061069e610ec4565b60005474010000000000000000000000000000000000000000900460ff16156106c657600080fd5b6106cf33610457565b15156106da57600080fd5b6004546001106106e957600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561074f57600080fd5b505af1158015610763573d6000803e3d6000fd5b505050506040513d602081101561077957600080fd5b505196506000871161078a57600080fd5b600194505b6004548510156109395760048054869081106107a757fe5b9060005260206000200160009054906101000a9004600160a060020a0316935083600160a060020a03166319a74ab36040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000Line truncated
"functionHashes": {
"addCoreTeam(address)": "2e6b6849",
"addSystem(address)": "74be7592",
@@ -178,25 +187,27 @@
"registerMiner(address)": "341ccfcb",
"renounceCoreTeam()": "d43acc79",
"renounceSystem()": "e9d61859",
"terminate()": "0c08bf88",
"unregisterMiner(address)": "81f909f3"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "686800",
"codeDepositCost": "777000",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"addCoreTeam(address)": "infinite",
"addSystem(address)": "infinite",
"getMinerByIndex(uint256)": "980",
"getMinerCount()": "633",
"getMinerByIndex(uint256)": "1002",
"getMinerCount()": "655",
"isCoreTeam(address)": "infinite",
"isSystem(address)": "infinite",
"mine()": "infinite",
"registerMiner(address)": "infinite",
"renounceCoreTeam()": "infinite",
"renounceSystem()": "infinite",
"terminate()": "infinite",
"unregisterMiner(address)": "infinite"
}
}
@@ -1 +1 @@
[{"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":"ownerAddress","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 @@
60806040523480156200001157600080fd5b506040516080806200104f83398101604090815281516020830151918301516060909301519092906200004d3364010000000062000103810204565b620000613364010000000062000121810204565b62000075336401000000006200013c810204565b60008360ff16101580156200008e575060058360ff1611155b15156200009a57600080fd5b6003805461ffff191661ffff959095169490941762ff000019166201000060ff949094169390930292909217630100000060b860020a0319166301000000600160a060020a03928316021790925560048054600160a060020a03191691909216179055620001ea565b6200011e60008264010000000062000d8f6200015782021704565b50565b6200011e60018264010000000062000d8f6200015782021704565b6200011e60028264010000000062000d8f6200015782021704565b600160a060020a03811615156200016d57600080fd5b620001828282640100000000620001b2810204565b156200018d57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a0382161515620001ca57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610e5580620001fa6000396000f30060806040526004361061013d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663162f986d81146101425780631777fb4b1461015957806319a74ab31461018257806321b79d9814610197578063231d4e2a146101ac57806329d10b6e146101cd5780632e6b6849146101ee578063302c11ca1461020f57806334cdcf2614610240578063363aa6c714610261578063427534a414610276578063608d3d3d1461028b57806374be7592146102ac57806380258e47146102cd57806381a24459146102f857806399f4b251146103195780639e614ca01461032e578063ada436e914610343578063b2a32cd514610364578063be95249414610379578063c6846ef81461038e578063d43acc79146103b5578063da408679146103ca578063e9d61859146103df575b600080fd5b34801561014e57600080fd5b506101576103f4565b005b34801561016557600080fd5b5061016e61045a565b604080519115158252519081900360200190f35b34801561018e57600080fd5b5061016e61045f565b3480156101a357600080fd5b50610157610496565b3480156101b857600080fd5b50610157600160a060020a0360043516610516565b3480156101d957600080fd5b50610157600160a060020a0360043516610602565b3480156101fa57600080fd5b50610157600160a060020a036004351661061f565b34801561021b57600080fd5b5061022461063c565b60408051600160a060020a039092168252519081900360200190f35b34801561024c57600080fd5b5061016e600160a060020a0360043516610652565b34801561026d57600080fd5b5061015761066a565b34801561028257600080fd5b50610157610713565b34801561029757600080fd5b5061016e600160a060020a0360043516610776565b3480156102b857600080fd5b50610157600160a060020a0360043516610789565b3480156102d957600080fd5b506102e26107a6565b6040805160ff9092168252519081900360200190f35b34801561030457600080fd5b5061016e600160a060020a03600435166107b5565b34801561032557600080fd5b506101576107c8565b34801561033a57600080fd5b50610157610999565b34801561034f57600080fd5b50610157600160a060020a03600435166109f3565b34801561037057600080fd5b50610157610a89565b34801561038557600080fd5b50610157610b9c565b34801561039a57600080fd5b506103a3610ba7565b60408051918252519081900360200190f35b3480156103c157600080fd5b50610157610bad565b3480156103d657600080fd5b50610157610bb6565b3480156103eb57600080fd5b50610157610c31565b6103fd336107b5565b151561040857600080fd5b600160045460a060020a900460ff16600381111561042257fe5b1461042c57600080fd5b600480546002919074ff0000000000000000000000000000000000000000191660a060020a835b0217905550565b600190565b6000600160045460a060020a900460ff16600381111561047b57fe5b148015610491575060045460a860020a900460ff165b905090565b60035463010000009004600160a060020a031633146104b457600080fd5b600160045460a060020a900460ff1660038111156104ce57fe5b146104d857600080fd5b60045460a860020a900460ff16156104ef57600080fd5b6004805475ff000000000000000000000000000000000000000000191660a860020a179055565b61051f33610776565b151561052a57600080fd5b600060045460a060020a900460ff16600381111561054457fe5b1461054e57600080fd5b60048054604080517f70a082310000000000000000000000000000000000000000000000000000000081523093810193909352516105ff928492600160a060020a0316916370a08231916024808201926020929091908290030181600087803b1580156105ba57600080fd5b505af11580156105ce573d6000803e3d6000fd5b505050506040513d60208110156105e457600080fd5b5051600454600160a060020a0316919063ffffffff610c3a16565b50565b61060b336107b5565b151561061657600080fd5b6105ff81610cf2565b61062833610776565b151561063357600080fd5b6105ff81610d03565b60035463010000009004600160a060020a031690565b6000610664818363ffffffff610d1416565b92915050565b610673336107b5565b151561067e57600080fd5b600360045460a060020a900460ff16600381111561069857fe5b14156106a357600080fd5b6004805474ff00000000000000000000000000000000000000001916740300000000000000000000000000000000000000001775ff000000000000000000000000000000000000000000191690556003805476ffffffffffffffffffffffffffffffffffffffff00000019169055565b61071c336107b5565b151561072757600080fd5b600260045460a060020a900460ff16600381111561074157fe5b1461074b57600080fd5b600480546001919074ff0000000000000000000000000000000000000000191660a060020a83610453565b600061066460018363ffffffff610d1416565b61079233610652565b151561079d57600080fd5b6105ff81610d4b565b60035462010000900460ff1690565b600061066460028363ffffffff610d1416565b6Line truncated
60806040523480156200001157600080fd5b5060405160a080620014c7833981016040908152815160208301519183015160608401516080909401516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790559294919262000087906401000000006200014c810204565b6200009b336401000000006200016a810204565b620000af3364010000000062000185810204565b60008460ff1610158015620000c8575060058460ff1611155b1515620000d457600080fd5b6005805486919060ff191660018381811115620000ed57fe5b0217905550506005805461ff00191661010060ff9590951694909402939093176201000060b060020a03191662010000600160a060020a03938416021790925560068054600160a060020a031916929091169190911790555062000233565b62000167600282640100000000620011be620001a082021704565b50565b62000167600382640100000000620011be620001a082021704565b62000167600482640100000000620011be620001a082021704565b600160a060020a0381161515620001b657600080fd5b620001cb8282640100000000620001fb810204565b15620001d657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200021357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61128480620002436000396000f30060806040526004361061017f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c08bf888114610184578063162f986d1461019b5780631777fb4b146101b057806319a74ab3146101d957806321b79d98146101ee578063231d4e2a1461020357806329d10b6e146102245780632e6b684914610245578063302c11ca14610266578063329b1c921461029757806334cdcf26146102ac578063363aa6c7146102cd5780633e6968b6146102e2578063427534a41461030e5780634969ae7014610323578063608d3d3d1461034e57806374be75921461036f57806380258e471461039057806381a24459146103a55780638329138f146103c657806399f4b251146103ed5780639e614ca014610402578063b2a32cd514610417578063be9524941461042c578063c6846ef814610441578063cdfd0f6414610468578063ce41607a1461047d578063d43acc7914610492578063da408679146104a7578063e9d61859146104bc575b600080fd5b34801561019057600080fd5b506101996104d1565b005b3480156101a757600080fd5b506101996104ef565b3480156101bc57600080fd5b506101c561055e565b604080519115158252519081900360200190f35b3480156101e557600080fd5b506101c5610563565b3480156101fa57600080fd5b5061019961059a565b34801561020f57600080fd5b50610199600160a060020a0360043516610630565b34801561023057600080fd5b50610199600160a060020a036004351661071c565b34801561025157600080fd5b50610199600160a060020a0360043516610739565b34801561027257600080fd5b5061027b610756565b60408051600160a060020a039092168252519081900360200190f35b3480156102a357600080fd5b5061027b61076b565b3480156102b857600080fd5b506101c5600160a060020a036004351661077a565b3480156102d957600080fd5b50610199610795565b3480156102ee57600080fd5b506102f7610846565b6040805161ffff9092168252519081900360200190f35b34801561031a57600080fd5b50610199610857565b34801561032f57600080fd5b506103386108c3565b6040805160ff9092168252519081900360200190f35b34801561035a57600080fd5b506101c5600160a060020a03600435166108d7565b34801561037b57600080fd5b50610199600160a060020a03600435166108ea565b34801561039c57600080fd5b50610338610907565b3480156103b157600080fd5b506101c5600160a060020a0360043516610915565b3480156103d257600080fd5b50610199600160a060020a0360043581169060243516610928565b3480156103f957600080fd5b506101996109db565b34801561040e57600080fd5b50610199610c2e565b34801561042357600080fd5b50610199610c9f565b34801561043857600080fd5b50610199610dfd565b34801561044d57600080fd5b50610456610e06565b60408051918252519081900360200190f35b34801561047457600080fd5b50610456610e0c565b34801561048957600080fd5b50610338610e12565b34801561049e57600080fd5b50610199610e35565b3480156104b357600080fd5b50610199610e3e565b3480156104c857600080fd5b50610199610ecf565b6104da336108d7565b15156104e557600080fd5b6104ed610ed8565b565b60005460a060020a900460ff161561050657600080fd5b61050f33610915565b151561051a57600080fd5b600160065460a060020a900460ff16600381111561053457fe5b1461053e57600080fd5b600680546002919060a060020a60ff02191660a060020a835b0217905550565b600190565b6000600160065460a060020a900460ff16600381111561057f57fe5b148015610595575060065460a860020a900460ff165b905090565b60005460a060020a900460ff16156105b157600080fd5b600554620100009004600160a060020a031633146105ce57600080fd5b600160065460a060020a900460ff1660038111156105e857fe5b146105f257600080fd5b60065460a860020a900460ff161561060957600080fd5b6006805475ff000000000000000000000000000000000000000000191660a860020a179055565b610639336108d7565b151561064457600080fd5b600060065460a060020a900460ff16600381111561065e57fe5b1461066857600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610719928492600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156106d457600080fd5b505af11580156106e8573d6000803e3d6000fd5b505050506040513d60208110156106fe57600080fd5b5051600154600160a060020a0316919063ffffffff610f9f16565b50565b61072533610915565b151561073057600080fd5b61071981611057565b610742336108d7565b151561074d57600080fd5b61071981611068565b600554620100009004600160a060020a031690565b600654600160a060020a031690565b600061078d6Line truncated
@@ -1,5 +1,14 @@
{
"abi": [
{
"constant": false,
"inputs": [],
"name": "terminate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
@@ -102,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": [
@@ -130,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": [],
@@ -139,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": [
@@ -205,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": [],
@@ -223,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": [],
@@ -269,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": [],
@@ -300,14 +383,18 @@
"inputs": [
{
"name": "minerType",
"type": "uint16"
"type": "uint8"
},
{
"name": "category",
"type": "uint8"
},
{
"name": "ownerAddress",
"name": "minerAccountAddress",
"type": "address"
},
{
"name": "referralAccountAddress",
"type": "address"
},
{
@@ -320,7 +407,7 @@
"type": "constructor"
}
],
"bytecode": "60806040523480156200001157600080fd5b506040516080806200104f83398101604090815281516020830151918301516060909301519092906200004d3364010000000062000103810204565b620000613364010000000062000121810204565b62000075336401000000006200013c810204565b60008360ff16101580156200008e575060058360ff1611155b15156200009a57600080fd5b6003805461ffff191661ffff959095169490941762ff000019166201000060ff949094169390930292909217630100000060b860020a0319166301000000600160a060020a03928316021790925560048054600160a060020a03191691909216179055620001ea565b6200011e60008264010000000062000d8f6200015782021704565b50565b6200011e60018264010000000062000d8f6200015782021704565b6200011e60028264010000000062000d8f6200015782021704565b600160a060020a03811615156200016d57600080fd5b620001828282640100000000620001b2810204565b156200018d57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a0382161515620001ca57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610e5580620001fa6000396000f30060806040526004361061013d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663162f986d81146101425780631777fb4b1461015957806319a74ab31461018257806321b79d9814610197578063231d4e2a146101ac57806329d10b6e146101cd5780632e6b6849146101ee578063302c11ca1461020f57806334cdcf2614610240578063363aa6c714610261578063427534a414610276578063608d3d3d1461028b57806374be7592146102ac57806380258e47146102cd57806381a24459146102f857806399f4b251146103195780639e614ca01461032e578063ada436e914610343578063b2a32cd514610364578063be95249414610379578063c6846ef81461038e578063d43acc79146103b5578063da408679146103ca578063e9d61859146103df575b600080fd5b34801561014e57600080fd5b506101576103f4565b005b34801561016557600080fd5b5061016e61045a565b604080519115158252519081900360200190f35b34801561018e57600080fd5b5061016e61045f565b3480156101a357600080fd5b50610157610496565b3480156101b857600080fd5b50610157600160a060020a0360043516610516565b3480156101d957600080fd5b50610157600160a060020a0360043516610602565b3480156101fa57600080fd5b50610157600160a060020a036004351661061f565b34801561021b57600080fd5b5061022461063c565b60408051600160a060020a039092168252519081900360200190f35b34801561024c57600080fd5b5061016e600160a060020a0360043516610652565b34801561026d57600080fd5b5061015761066a565b34801561028257600080fd5b50610157610713565b34801561029757600080fd5b5061016e600160a060020a0360043516610776565b3480156102b857600080fd5b50610157600160a060020a0360043516610789565b3480156102d957600080fd5b506102e26107a6565b6040805160ff9092168252519081900360200190f35b34801561030457600080fd5b5061016e600160a060020a03600435166107b5565b34801561032557600080fd5b506101576107c8565b34801561033a57600080fd5b50610157610999565b34801561034f57600080fd5b50610157600160a060020a03600435166109f3565b34801561037057600080fd5b50610157610a89565b34801561038557600080fd5b50610157610b9c565b34801561039a57600080fd5b506103a3610ba7565b60408051918252519081900360200190f35b3480156103c157600080fd5b50610157610bad565b3480156103d657600080fd5b50610157610bb6565b3480156103eb57600080fd5b50610157610c31565b6103fd336107b5565b151561040857600080fd5b600160045460a060020a900460ff16600381111561042257fe5b1461042c57600080fd5b600480546002919074ff0000000000000000000000000000000000000000191660a060020a835b0217905550565b600190565b6000600160045460a060020a900460ff16600381111561047b57fe5b148015610491575060045460a860020a900460ff165b905090565b60035463010000009004600160a060020a031633146104b457600080fd5b600160045460a060020a900460ff1660038111156104ce57fe5b146104d857600080fd5b60045460a860020a900460ff16156104ef57600080fd5b6004805475ff000000000000000000000000000000000000000000191660a860020a179055565b61051f33610776565b151561052a57600080fd5b600060045460a060020a900460ff16600381111561054457fe5b1461054e57600080fd5b60048054604080517f70a082310000000000000000000000000000000000000000000000000000000081523093810193909352516105ff928492600160a060020a0316916370a08231916024808201926020929091908290030181600087803b1580156105ba57600080fd5b505af11580156105ce573d6000803e3d6000fd5b505050506040513d60208110156105e457600080fd5b5051600454600160a060020a0316919063ffffffff610c3a16565b50565b61060b336107b5565b151561061657600080fd5b6105ff81610cf2565b61062833610776565b151561063357600080fd5b6105ff81610d03565b60035463010000009004600160a060020a031690565b6000610664818363ffffffff610d1416565b92915050565b610673336107b5565b151561067e57600080fd5b600360045460a060020a900460ff16600381111561069857fe5b14156106a357600080fd5b6004805474ff00000000000000000000000000000000000000001916740300000000000000000000000000000000000000001775ff000000000000000000000000000000000000000000191690556003805476ffffffffffffffffffffffffffffffffffffffff00000019169055565b61071c336107b5565b151561072757600080fd5b600260045460a060020a900460ff16600381111561074157fe5b1461074b57600080fd5b600480546001919074ff0000000000000000000000000000000000000000191660a060020a83610453565b600061066460018363ffffffff610d1416565b61079233610652565b151561079d57600080fd5b6105ff81610d4b565b60035462010000900460ff1690565b600061066460028363ffffLine truncated
"bytecode": "60806040523480156200001157600080fd5b5060405160a080620014c7833981016040908152815160208301519183015160608401516080909401516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790559294919262000087906401000000006200014c810204565b6200009b336401000000006200016a810204565b620000af3364010000000062000185810204565b60008460ff1610158015620000c8575060058460ff1611155b1515620000d457600080fd5b6005805486919060ff191660018381811115620000ed57fe5b0217905550506005805461ff00191661010060ff9590951694909402939093176201000060b060020a03191662010000600160a060020a03938416021790925560068054600160a060020a031916929091169190911790555062000233565b62000167600282640100000000620011be620001a082021704565b50565b62000167600382640100000000620011be620001a082021704565b62000167600482640100000000620011be620001a082021704565b600160a060020a0381161515620001b657600080fd5b620001cb8282640100000000620001fb810204565b15620001d657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200021357600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61128480620002436000396000f30060806040526004361061017f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c08bf888114610184578063162f986d1461019b5780631777fb4b146101b057806319a74ab3146101d957806321b79d98146101ee578063231d4e2a1461020357806329d10b6e146102245780632e6b684914610245578063302c11ca14610266578063329b1c921461029757806334cdcf26146102ac578063363aa6c7146102cd5780633e6968b6146102e2578063427534a41461030e5780634969ae7014610323578063608d3d3d1461034e57806374be75921461036f57806380258e471461039057806381a24459146103a55780638329138f146103c657806399f4b251146103ed5780639e614ca014610402578063b2a32cd514610417578063be9524941461042c578063c6846ef814610441578063cdfd0f6414610468578063ce41607a1461047d578063d43acc7914610492578063da408679146104a7578063e9d61859146104bc575b600080fd5b34801561019057600080fd5b506101996104d1565b005b3480156101a757600080fd5b506101996104ef565b3480156101bc57600080fd5b506101c561055e565b604080519115158252519081900360200190f35b3480156101e557600080fd5b506101c5610563565b3480156101fa57600080fd5b5061019961059a565b34801561020f57600080fd5b50610199600160a060020a0360043516610630565b34801561023057600080fd5b50610199600160a060020a036004351661071c565b34801561025157600080fd5b50610199600160a060020a0360043516610739565b34801561027257600080fd5b5061027b610756565b60408051600160a060020a039092168252519081900360200190f35b3480156102a357600080fd5b5061027b61076b565b3480156102b857600080fd5b506101c5600160a060020a036004351661077a565b3480156102d957600080fd5b50610199610795565b3480156102ee57600080fd5b506102f7610846565b6040805161ffff9092168252519081900360200190f35b34801561031a57600080fd5b50610199610857565b34801561032f57600080fd5b506103386108c3565b6040805160ff9092168252519081900360200190f35b34801561035a57600080fd5b506101c5600160a060020a03600435166108d7565b34801561037b57600080fd5b50610199600160a060020a03600435166108ea565b34801561039c57600080fd5b50610338610907565b3480156103b157600080fd5b506101c5600160a060020a0360043516610915565b3480156103d257600080fd5b50610199600160a060020a0360043581169060243516610928565b3480156103f957600080fd5b506101996109db565b34801561040e57600080fd5b50610199610c2e565b34801561042357600080fd5b50610199610c9f565b34801561043857600080fd5b50610199610dfd565b34801561044d57600080fd5b50610456610e06565b60408051918252519081900360200190f35b34801561047457600080fd5b50610456610e0c565b34801561048957600080fd5b50610338610e12565b34801561049e57600080fd5b50610199610e35565b3480156104b357600080fd5b50610199610e3e565b3480156104c857600080fd5b50610199610ecf565b6104da336108d7565b15156104e557600080fd5b6104ed610ed8565b565b60005460a060020a900460ff161561050657600080fd5b61050f33610915565b151561051a57600080fd5b600160065460a060020a900460ff16600381111561053457fe5b1461053e57600080fd5b600680546002919060a060020a60ff02191660a060020a835b0217905550565b600190565b6000600160065460a060020a900460ff16600381111561057f57fe5b148015610595575060065460a860020a900460ff165b905090565b60005460a060020a900460ff16156105b157600080fd5b600554620100009004600160a060020a031633146105ce57600080fd5b600160065460a060020a900460ff1660038111156105e857fe5b146105f257600080fd5b60065460a860020a900460ff161561060957600080fd5b6006805475ff000000000000000000000000000000000000000000191660a860020a179055565b610639336108d7565b151561064457600080fd5b600060065460a060020a900460ff16600381111561065e57fe5b1461066857600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610719928492600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156106d457600080fd5b505af11580156106e8573d6000803e3d6000fd5b505050506040513d60208110156106fe57600080fd5b5051600154600160a060020a0316919063ffffffff610f9f16565b50565b61072533610915565b151561073057600080fd5b61071981611057565b610742336108d7565b151561074d57600080fd5b61071981611068565b600554620100009004600160a060020a031690565b600654600160a060020a0316Line truncated
"functionHashes": {
"DAYS_PER_YEAR()": "c6846ef8",
"activateMiner()": "b2a32cd5",
@@ -329,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",
@@ -341,30 +433,36 @@
"renounceCoreTeam()": "d43acc79",
"renounceSupervisor()": "be952494",
"renounceSystem()": "e9d61859",
"resetMiner(address)": "ada436e9",
"resetMiner(address,address)": "8329138f",
"resumeMining()": "427534a4",
"startMining()": "21b79d98",
"stopAndRemoveOwnership()": "363aa6c7",
"stopMining()": "da408679"
"stopMining()": "da408679",
"terminate()": "0c08bf88"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "733800",
"codeDepositCost": "948000",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"DAYS_PER_YEAR()": "624",
"DAYS_PER_YEAR()": "712",
"activateMiner()": "infinite",
"addCoreTeam(address)": "infinite",
"addSupervisor(address)": "infinite",
"addSystem(address)": "infinite",
"deactivateMiner()": "infinite",
"getCategory()": "696",
"getMiner()": "702",
"isAlgoMiner()": "212",
"getCategory()": "784",
"getCurrentDay()": "737",
"getCurrentYear()": "982",
"getCurrentYearSupply()": "934",
"getMiner()": "724",
"getMinerType()": "744",
"getReferral()": "735",
"isAlgoMiner()": "234",
"isCoreTeam(address)": "infinite",
"isMining()": "859",
"isMining()": "881",
"isSupervisor(address)": "infinite",
"isSystem(address)": "infinite",
"migrateMiner(address)": "infinite",
@@ -373,11 +471,12 @@
"renounceCoreTeam()": "infinite",
"renounceSupervisor()": "infinite",
"renounceSystem()": "infinite",
"resetMiner(address)": "infinite",
"resetMiner(address,address)": "infinite",
"resumeMining()": "infinite",
"startMining()": "21420",
"startMining()": "21742",
"stopAndRemoveOwnership()": "infinite",
"stopMining()": "21772"
"stopMining()": "22204",
"terminate()": "infinite"
}
}
}
@@ -1 +1 @@
[{"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 @@
608060405234801561001057600080fd5b506040516040806107aa83398101604052805160209091015161003b33640100000000610077810204565b60018054600160a060020a0390921662010000026201000060b060020a031961ffff90941661ffff199093169290921792909216179055610120565b61008f6000826401000000006105b561009282021704565b50565b600160a060020a03811615156100a757600080fd5b6100ba82826401000000006100e9810204565b156100c457600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561010057600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61067b8061012f6000396000f3006080604052600436106100955763ffffffff60e060020a6000350416632296f4c7811461009a57806325109e8b146100bd5780632e6b6849146100e4578063455acbcd14610105578063492fba841461011a57806349dc9ed01461012f578063608d3d3d146101445780639fc3c98314610179578063a89febb21461018e578063aed6183f146101a3578063d43acc79146101b8575b600080fd5b3480156100a657600080fd5b506100bb600160a060020a03600435166101cd565b005b3480156100c957600080fd5b506100d2610416565b60408051918252519081900360200190f35b3480156100f057600080fd5b506100bb600160a060020a0360043516610422565b34801561011157600080fd5b506100d2610442565b34801561012657600080fd5b506100d2610451565b34801561013b57600080fd5b506100d261045f565b34801561015057600080fd5b50610165600160a060020a036004351661046e565b604080519115158252519081900360200190f35b34801561018557600080fd5b506100d2610486565b34801561019a57600080fd5b506100d2610494565b3480156101af57600080fd5b506100d26104a3565b3480156101c457600080fd5b506100bb6104b2565b60008060006101db3361046e565b15156101e657600080fd5b600160a060020a03841660009081526002602052604090205460ff161561020c57600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561024d57600080fd5b505af1158015610261573d6000803e3d6000fd5b505050506040513d602081101561027757600080fd5b5051151561028457600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050506040513d60208110156102ec57600080fd5b50519150600060ff831610801590610308575060058260ff1611155b151561031357600080fd5b50600060ff82161515610331575069152d02c7e14af68000006103c2565b8160ff166001141561034e575069d3c21bcecceda10000006103c2565b8160ff166002141561036c57506a01a784379d99db420000006103c2565b8160ff166003141561038a57506a027b46536c66c8e30000006103c2565b8160ff16600414156103a857506a034f086f3b33b6840000006103c2565b8160ff16600514156103c257506a0422ca8b0a00a4250000005b600081116103cf57600080fd5b600160a060020a038085166000908152600260205260409020805460ff1916600190811790915554610410916201000090910416858363ffffffff6104bd16565b50505050565b670de0b6b3a764000081565b61042b3361046e565b151561043657600080fd5b61043f8161055c565b50565b6a034f086f3b33b68400000081565b69d3c21bcecceda100000081565b6a027b46536c66c8e300000081565b6000610480818363ffffffff61056d16565b92915050565b69152d02c7e14af680000081565b6a0422ca8b0a00a42500000081565b6a01a784379d99db4200000081565b6104bb336105a4565b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561052057600080fd5b505af1158015610534573d6000803e3d6000fd5b505050506040513d602081101561054a57600080fd5b5051151561055757600080fd5b505050565b61043f60008263ffffffff6105b516565b6000600160a060020a038216151561058457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61043f60008263ffffffff61060316565b600160a060020a03811615156105ca57600080fd5b6105d4828261056d565b156105de57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561061857600080fd5b610622828261056d565b151561062d57600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a723058200648204d7a0ac13aa2e9ab7514200c49dd33ae54f0178fd146385ad3444f20ee0029
608060405234801561001057600080fd5b506040516040806107f28339810160405280516020909101516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a03841617905561006f90640100000000610093810204565b6003805483919060ff19166001838181111561008757fe5b0217905550505061013c565b6100ab6002826401000000006105e16100ae82021704565b50565b600160a060020a03811615156100c357600080fd5b6100d68282640100000000610105810204565b156100e057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561011c57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6106a78061014b6000396000f3006080604052600436106100535763ffffffff60e060020a6000350416630c08bf8881146100585780632296f4c71461006f5780632e6b684914610090578063608d3d3d146100b1578063d43acc79146100e6575b600080fd5b34801561006457600080fd5b5061006d6100fb565b005b34801561007b57600080fd5b5061006d600160a060020a0360043516610119565b34801561009c57600080fd5b5061006d600160a060020a03600435166102f5565b3480156100bd57600080fd5b506100d2600160a060020a0360043516610315565b604080519115158252519081900360200190f35b3480156100f257600080fd5b5061006d610330565b61010433610315565b151561010f57600080fd5b610117610339565b565b600080548190819074010000000000000000000000000000000000000000900460ff161561014657600080fd5b61014f33610315565b151561015a57600080fd5b600160a060020a03841660009081526004602052604090205460ff161561018057600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156101c157600080fd5b505af11580156101d5573d6000803e3d6000fd5b505050506040513d60208110156101eb57600080fd5b505115156101f857600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561023657600080fd5b505af115801561024a573d6000803e3d6000fd5b505050506040513d602081101561026057600080fd5b50519150600060ff83161080159061027c575060058260ff1611155b151561028757600080fd5b61029082610400565b9050600160035460ff1660018111156102a557fe5b14156102b5576064600a82020490505b600160a060020a038085166000908152600460205260409020805460ff19166001908117909155546102ef9116858363ffffffff6104b216565b50505050565b6102fe33610315565b151561030957600080fd5b61031281610551565b50565b600061032860028363ffffffff61056216565b90505b919050565b61011733610599565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561039e57600080fd5b505af11580156103b2573d6000803e3d6000fd5b505050506040513d60208110156103c857600080fd5b5051905060008111156103f8576000546001546103f891600160a060020a0391821691168363ffffffff6104b216565b6103126105aa565b600060ff8216151561041d575069152d02c7e14af680000061032b565b8160ff166001141561043a575069d3c21bcecceda100000061032b565b8160ff166002141561045857506a01a784379d99db4200000061032b565b8160ff166003141561047657506a027b46536c66c8e300000061032b565b8160ff166004141561049457506a034f086f3b33b68400000061032b565b8160ff166005141561032b57506a0422ca8b0a00a42500000061032b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561051557600080fd5b505af1158015610529573d6000803e3d6000fd5b505050506040513d602081101561053f57600080fd5b5051151561054c57600080fd5b505050565b61031260028263ffffffff6105e116565b6000600160a060020a038216151561057957600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61031260028263ffffffff61062f16565b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a03811615156105f657600080fd5b6106008282610562565b1561060a57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561064457600080fd5b61064e8282610562565b151561065957600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a723058208317cc38f72fdbf4d19029db12a6c784275ab5dfd7521863b2c79aee26e6effb0029
@@ -1,5 +1,14 @@
{
"abi": [
{
"constant": false,
"inputs": [],
"name": "terminate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
@@ -14,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": [
@@ -42,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": [
@@ -103,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": [],
@@ -158,7 +69,7 @@
"inputs": [
{
"name": "poolType",
"type": "uint16"
"type": "uint8"
},
{
"name": "tokenAddress",
@@ -170,37 +81,25 @@
"type": "constructor"
}
],
"bytecode": "608060405234801561001057600080fd5b506040516040806107aa83398101604052805160209091015161003b33640100000000610077810204565b60018054600160a060020a0390921662010000026201000060b060020a031961ffff90941661ffff199093169290921792909216179055610120565b61008f6000826401000000006105b561009282021704565b50565b600160a060020a03811615156100a757600080fd5b6100ba82826401000000006100e9810204565b156100c457600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561010057600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61067b8061012f6000396000f3006080604052600436106100955763ffffffff60e060020a6000350416632296f4c7811461009a57806325109e8b146100bd5780632e6b6849146100e4578063455acbcd14610105578063492fba841461011a57806349dc9ed01461012f578063608d3d3d146101445780639fc3c98314610179578063a89febb21461018e578063aed6183f146101a3578063d43acc79146101b8575b600080fd5b3480156100a657600080fd5b506100bb600160a060020a03600435166101cd565b005b3480156100c957600080fd5b506100d2610416565b60408051918252519081900360200190f35b3480156100f057600080fd5b506100bb600160a060020a0360043516610422565b34801561011157600080fd5b506100d2610442565b34801561012657600080fd5b506100d2610451565b34801561013b57600080fd5b506100d261045f565b34801561015057600080fd5b50610165600160a060020a036004351661046e565b604080519115158252519081900360200190f35b34801561018557600080fd5b506100d2610486565b34801561019a57600080fd5b506100d2610494565b3480156101af57600080fd5b506100d26104a3565b3480156101c457600080fd5b506100bb6104b2565b60008060006101db3361046e565b15156101e657600080fd5b600160a060020a03841660009081526002602052604090205460ff161561020c57600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561024d57600080fd5b505af1158015610261573d6000803e3d6000fd5b505050506040513d602081101561027757600080fd5b5051151561028457600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050506040513d60208110156102ec57600080fd5b50519150600060ff831610801590610308575060058260ff1611155b151561031357600080fd5b50600060ff82161515610331575069152d02c7e14af68000006103c2565b8160ff166001141561034e575069d3c21bcecceda10000006103c2565b8160ff166002141561036c57506a01a784379d99db420000006103c2565b8160ff166003141561038a57506a027b46536c66c8e30000006103c2565b8160ff16600414156103a857506a034f086f3b33b6840000006103c2565b8160ff16600514156103c257506a0422ca8b0a00a4250000005b600081116103cf57600080fd5b600160a060020a038085166000908152600260205260409020805460ff1916600190811790915554610410916201000090910416858363ffffffff6104bd16565b50505050565b670de0b6b3a764000081565b61042b3361046e565b151561043657600080fd5b61043f8161055c565b50565b6a034f086f3b33b68400000081565b69d3c21bcecceda100000081565b6a027b46536c66c8e300000081565b6000610480818363ffffffff61056d16565b92915050565b69152d02c7e14af680000081565b6a0422ca8b0a00a42500000081565b6a01a784379d99db4200000081565b6104bb336105a4565b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561052057600080fd5b505af1158015610534573d6000803e3d6000fd5b505050506040513d602081101561054a57600080fd5b5051151561055757600080fd5b505050565b61043f60008263ffffffff6105b516565b6000600160a060020a038216151561058457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61043f60008263ffffffff61060316565b600160a060020a03811615156105ca57600080fd5b6105d4828261056d565b156105de57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561061857600080fd5b610622828261056d565b151561062d57600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a723058200648204d7a0ac13aa2e9ab7514200c49dd33ae54f0178fd146385ad3444f20ee0029",
"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",
"terminate()": "0c08bf88",
"trasferToMiner(address)": "2296f4c7"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "331800",
"codeDepositCost": "340600",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"CAT_0_VALUE()": "401",
"CAT_1_VALUE()": "335",
"CAT_2_VALUE()": "445",
"CAT_3_VALUE()": "357",
"CAT_4_VALUE()": "313",
"CAT_5_VALUE()": "423",
"TOKEN_FACTOR()": "269",
"addCoreTeam(address)": "infinite",
"isCoreTeam(address)": "infinite",
"renounceCoreTeam()": "infinite",
"terminate()": "infinite",
"trasferToMiner(address)": "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));
}
}
}
+10 -8
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> <ownerAddress> <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)
* `ownerAddress`: the address of the miner's owner
* `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 +1 @@
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/osx-x64 --self-contained -r osx-x64 --no-restore
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/osx-x64 --self-contained -r osx-x64
@@ -1,2 +1,2 @@
#!/bin/bash
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/osx-x64 --self-contained -r osx-x64 --no-restore
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/osx-x64 --self-contained -r osx-x64
@@ -1 +1 @@
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/win-x64 --self-contained -r win-x64 --no-restore
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/win-x64 --self-contained -r win-x64
@@ -1,2 +1,2 @@
#!/bin/bash
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/win-x64 --self-contained -r win-x64 --no-restore
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/win-x64 --self-contained -r win-x64
@@ -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 OwnerAddress { 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)
@@ -25,7 +26,8 @@ namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
return await algoMiner.DeployAsync(
MinerType,
Category,
context.ResolveAccountReference(OwnerAddress),
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 ownerAddress in CommonParsers.StringValue
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,
OwnerAddress = ownerAddress,
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}'.");