Skip to content

Commit

Permalink
feat: added rinkeby network
Browse files Browse the repository at this point in the history
  • Loading branch information
0x31 committed Oct 26, 2020
1 parent 4438b1d commit e4e29f0
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 11 deletions.
4 changes: 2 additions & 2 deletions contracts/DarknodePayment/DarknodePayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ contract DarknodePayment is Claimable {
string public VERSION; // Passed in as a constructor parameter.

/// @notice The special address for Ether.
address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address
public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

DarknodeRegistryLogicV1 public darknodeRegistry; // Passed in as a constructor parameter.

Expand Down Expand Up @@ -514,5 +515,4 @@ contract DarknodePayment is Claimable {
}
pendingTokens.length = 0;
}

}
4 changes: 2 additions & 2 deletions contracts/DarknodePayment/DarknodePaymentStore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ contract DarknodePaymentStore is Claimable {
string public VERSION; // Passed in as a constructor parameter.

/// @notice The special address for Ether.
address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address
public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

/// @notice Mapping of darknode -> token -> balance.
mapping(address => mapping(address => uint256)) public darknodeBalances;
Expand Down Expand Up @@ -117,5 +118,4 @@ contract DarknodePaymentStore is Claimable {
ERC20(_token).safeTransfer(_recipient, _amount);
}
}

}
21 changes: 14 additions & 7 deletions contracts/DarknodeRegistry/DarknodeRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface IDarknodePaymentStore {}

interface IDarknodePayment {
function changeCycle() external returns (uint256);

function store() external view returns (IDarknodePaymentStore);
}

Expand Down Expand Up @@ -439,11 +440,11 @@ contract DarknodeRegistryLogicV1 is
/// @param _guilty The guilty prover whose bond is being slashed.
/// @param _challenger The challenger who should receive a portion of the bond as reward.
/// @param _percentage The total percentage of bond to be slashed.
function slash(address _guilty, address _challenger, uint256 _percentage)
external
onlySlasher
onlyDarknode(_guilty)
{
function slash(
address _guilty,
address _challenger,
uint256 _percentage
) external onlySlasher onlyDarknode(_guilty) {
require(_percentage <= 100, "DarknodeRegistry: invalid percent");

// If the darknode has not been deregistered then deregister it
Expand Down Expand Up @@ -730,7 +731,11 @@ contract DarknodeRegistryLogicV1 is
function getDarknodeCountFromEpochs()
private
view
returns (uint256, uint256, uint256)
returns (
uint256,
uint256,
uint256
)
{
// Begin with the first node in the list
uint256 nPreviousEpoch = 0;
Expand Down Expand Up @@ -768,4 +773,6 @@ contract DarknodeRegistryLogicV1 is
}

/* solium-disable-next-line no-empty-blocks */
contract DarknodeRegistryProxy is InitializableAdminUpgradeabilityProxy {}
contract DarknodeRegistryProxy is InitializableAdminUpgradeabilityProxy {

}
39 changes: 39 additions & 0 deletions migrations/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,45 @@ module.exports = {
},
},

rinkebyDevnet: {
/* 1_darknodes.js */

RenProxyAdmin: "0xed01c6323829CbFD3b6bAC8Baa11C7aC8A0F26fb",
RenToken: "0x8BCCcA938b311029948F70249709CAd7c0F28Bb4",

// Protocol
ProtocolLogicV1: "0x9Cc2d9cCea0AE9f7EDD91Cf91ab74074EeDbABE1",
ProtocolProxy: "0xc5786B864D1DaF57D653470f2fd0c921dC080953",

// DNR
DarknodeRegistryStore: "0x93151b8c88A7f6004656556880e2a3E701452375",
DarknodeRegistryLogicV1: "0xD46dc8a22B980C871207bC57b0e524C46cfB4c1B",
DarknodeRegistryProxy: "0x74d0651259Cd63e7c15Dc11e3787dB1D80D41d9E",

// DNP
DarknodePaymentStore: "0x0a1b343bB36dA2593d15162c8e0370eF5E0085B1",
DarknodePayment: "0x40BC55A28f07D2208c1a9Da4008912BFcc617463",

// Slasher
DarknodeSlasher: "0x78eFADC45D1ba7a2E51072F73b3C2E5Be1ca1B10",

tokens: {
DAI: "0x5592ec0cfb4dbc12d3ab100b257153436a1f0fea",
ETH: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
},

/* 2_shifter.js */

GatewayRegistry: "0xcF9F36668ad5b28B336B248a67268AFcF1ECbdbF",

config: {
...config,
mintAuthority: "0xbb8c61159153d8a6ffd555584d1ac77fd57feca7",

tokenPrefix: "dev",
},
},

localnet: {
/* 1_darknodes.js */

Expand Down
11 changes: 11 additions & 0 deletions truffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,21 @@ const mainNetwork = {
networkCheckTimeout: 10000,
};

const ethRinkebyNetwork = {
// @ts-ignore
provider: () => new HDWalletProvider(process.env.MNEMONIC_TESTNET || process.env.MNEMONIC_KOVAN, `https://rinkeby.infura.io/v3/${process.env.INFURA_KEY}`),
network_id: 4,
// gas: 6721975,
// gasPrice: 6.5 * GWEI,
networkCheckTimeout: 10000,
};


module.exports = {
networks: {
localnet: kovanNetwork,
devnet: kovanNetwork,
rinkebyDevnet: ethRinkebyNetwork,
testnet: kovanNetwork,
mainnet: mainNetwork,
chaosnet: mainNetwork,
Expand Down

0 comments on commit e4e29f0

Please sign in to comment.