Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goerli migration #348

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The bridges on each contract are upgradeable, this would enable a smooth transit
You can use the ['Token Bridge Dapp'](https://tokenbridge.rsk.co/) together with [Nifty Wallet](https://chrome.google.com/webstore/detail/nifty-wallet/jbdaocneiiinmjbjlgalhcelgbejmnid) or [Metamask with custom network](https://github.com/rsksmart/rskj/wiki/Configure-Metamask-to-connect-with-RSK) to move tokens between networks. This is the [Dapp guide](https://developers.rsk.co/tools/tokenbridge/dappguide/) if you don't know how to use it.
Or you can use a wallet with the abi of the contracts. See the ['interaction guide using MyCrypto'](https://developers.rsk.co/tools/tokenbridge/usingmycrypto/) for more information on how to use the bridge.

## Contracts deployed on RSK, Ethereum, RSK Testnet and Kovan
## Contracts deployed on RSK, Ethereum, RSK Testnet and Goerli

Here are the ['addresses'](./docs/ContractAddresses.md) of the deployed contracts in the different networks.

Expand Down
2 changes: 1 addition & 1 deletion bridge/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ etherscan.key
#Truffle
.openzeppelin/.session
.openzeppelin/dev-*.json
.openzeppelin/kovan.json
.openzeppelin/goerli.json
.openzeppelin/mainnet.json
coverage/
coverage.json
Expand Down
4 changes: 2 additions & 2 deletions bridge/contracts/zeppelin/upgradable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

**OpenZeppelin Contracts is a library for secure smart contract development.** It provides implementations of standards like ERC20 and ERC721 which you can deploy as-is or extend to suit your needs, as well as Solidity components to build custom contracts and more complex decentralized systems.

This fork of OpenZeppelin is set up as a **reusable Ethereum Package**. It is deployed to the kovan, rinkeby, and ropsten test networks, as well as to the main Ethereum network. You can reuse any of the pre-deployed on-chain contracts by simply linking to them using the [OpenZeppelin SDK](https://github.com/openzeppelin/openzeppelin-sdk), or reuse their Solidity source code as with the [vanilla version of OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts).
This fork of OpenZeppelin is set up as a **reusable Ethereum Package**. It is deployed to the goerli, rinkeby, and ropsten test networks, as well as to the main Ethereum network. You can reuse any of the pre-deployed on-chain contracts by simply linking to them using the [OpenZeppelin SDK](https://github.com/openzeppelin/openzeppelin-sdk), or reuse their Solidity source code as with the [vanilla version of OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts).

## Differences with openzeppelin-contracts

Expand All @@ -30,7 +30,7 @@ npm install @openzeppelin/contracts-ethereum-package

## Using via the OpenZeppelin CLI

You can easily create upgradeable instances of any of the logic contracts listed above using the OpenZeppelin CLI. This will rely on the pre-deployed instances in mainnet, kovan, ropsten, or rinkeby, greatly reducing your gas deployment costs. To do this, just [create a new OpenZeppelin SDK project](https://docs.zeppelinos.org/docs/deploying.html) and [link to this package](https://docs.zeppelinos.org/docs/linking.html).
You can easily create upgradeable instances of any of the logic contracts listed above using the OpenZeppelin CLI. This will rely on the pre-deployed instances in mainnet, goerli, ropsten, or rinkeby, greatly reducing your gas deployment costs. To do this, just [create a new OpenZeppelin SDK project](https://docs.zeppelinos.org/docs/deploying.html) and [link to this package](https://docs.zeppelinos.org/docs/linking.html).

```bash
$ npm install -g @openzeppelin/cli
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/01_deploy_multiSigWallet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const {deploy1820} = require('@thinkanddev/deploy-eip-1820-web3-rsk');
const {web3} = require("hardhat");

module.exports = async function({getNamedAccounts, deployments, network}) { // HardhatRuntimeEnvironment
const {deployer, multiSig} = await getNamedAccounts();
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/02_deploy_proxyAdmin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const address = require('../hardhat/helper/address');
const chains = require("../hardhat/helper/chains");

module.exports = async function(hre) { // HardhatRuntimeEnvironment
const {getNamedAccounts, deployments} = hre;
Expand Down
3 changes: 2 additions & 1 deletion bridge/deploy/04_deploy_bridge.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const address = require('../hardhat/helper/address');
const chains = require("../hardhat/helper/chains");
const {web3} = require("hardhat");

module.exports = async function(hre) { // HardhatRuntimeEnvironment
const {deployments, network} = hre;
const {deployer} = await getNamedAccounts();
const {deployer} = await hre.getNamedAccounts();
const {deploy, log} = deployments;
const BRIDGE_LAST_VERSION = 'v4'

Expand Down
9 changes: 6 additions & 3 deletions bridge/deploy/05_deploy_bridgeProxy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const chains = require('../hardhat/helper/chains');
const address = require('../hardhat/helper/address');
const {web3} = require("hardhat");

module.exports = async function (hre) { // HardhatRuntimeEnvironment
const {getNamedAccounts, deployments, network} = hre;
Expand Down Expand Up @@ -30,19 +31,21 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment
methodCall.encodeABI()
];

const deployProxyResult = await deploy('BridgeProxy', {
const deployResult = await deploy('BridgeProxy', {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let the name deployProxyResult because we are deploying a proxy contract in here

from: deployer,
args: constructorArguments,
log: true,
});
if (deployProxyResult.newlyDeployed) {
log(`Contract BridgeProxy deployed at ${deployProxyResult.address} using ${deployProxyResult.receipt.gasUsed.toString()} gas`);

if (deployResult.newlyDeployed) {
log(`Contract BridgeProxy deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed.toString()} gas`);

if(network.live && !chains.isRSK(network)) {
log(`Startig Verification of ${deployResult.address}`);
await hre.run("verify:verify", {
address: deployResult.address,
constructorArguments: constructorArguments,
contract: 'contracts/Proxies.sol:BridgeProxy'
});
}
}
Expand Down
3 changes: 2 additions & 1 deletion bridge/deploy/06_deploy_federation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const address = require('../hardhat/helper/address');
const chains = require('../hardhat/helper/chains');
const {web3} = require("hardhat");

module.exports = async function(hre) { // HardhatRuntimeEnvironment
const {deployments, network} = hre;
const {deployments, network, getNamedAccounts} = hre;
const {deployer} = await getNamedAccounts();
const {deploy, log} = deployments;
const FEDERATION_LAST_VERSION = 'v3'
Expand Down
2 changes: 1 addition & 1 deletion bridge/deploy/07_deploy_federationProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports.dependencies = ['MultiSigWallet', 'ProxyAdmin', 'Federation', 'Br

function getFederationConf(deployer, network) {
const networkName = network.name.toLowerCase();
if (networkName.includes('testnet') || networkName.includes('kovan') || networkName.includes('rinkeby')) {
if (networkName.includes('testnet') || networkName.includes('goerli') || networkName.includes('rinkeby')) {
return {
members: ['0x8f397ff074ff190fc650e5cab4da039a8163e12a'],
required: 1,
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/08_deploy_allowToken.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const address = require('../hardhat/helper/address');
const chains = require('../hardhat/helper/chains');
const {web3} = require("hardhat");

module.exports = async function(hre) { // HardhatRuntimeEnvironment
const {getNamedAccounts, deployments, network} = hre;
Expand Down
3 changes: 2 additions & 1 deletion bridge/deploy/09_deploy_allowTokensProxy.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// We are actually gonna use the latest Bridge but truffle only knows the address of the proxy
const toWei = web3.utils.toWei;
const deployHelper = require('../deployed/deployHelper');
const chains = require('../hardhat/helper/chains');
const address = require('../hardhat/helper/address');
const {web3} = require("hardhat");
const toWei = web3.utils.toWei;

module.exports = async function(hre) { // HardhatRuntimeEnvironment
const {getNamedAccounts, deployments, network} = hre;
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/10_transfer_setTokens_allowTokens.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { tokensByChainId } = require("../hardhat/helper/tokens");
const address = require('../hardhat/helper/address');
const {web3} = require("hardhat");

function formatToken(token) {
return {token: token.address, typeId: token.typeId};
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/11_transfer_sideTokenFactoryToBridge.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const {web3} = require("hardhat");
const sideTokenFactoryName = 'SideTokenFactory';
const bridgeProxyName = 'BridgeProxy';
const GAS_LIMIT = 4000000;
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/12_transfer_federationToBridge.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const address = require('../hardhat/helper/address');
const {web3} = require("hardhat");

module.exports = async function (hre) { // HardhatRuntimeEnvironment
const {getNamedAccounts, deployments} = hre;
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/13_transfer_allowTokensToBridge.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const address = require('../hardhat/helper/address');
const {web3} = require("hardhat");

module.exports = async function (hre) { // HardhatRuntimeEnvironment
const {getNamedAccounts, deployments} = hre;
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/14_conditional_deploy_mainToken.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const {web3} = require("hardhat");
module.exports = async function ({getNamedAccounts, deployments, network}) { // HardhatRuntimeEnvironment
const {deployer} = await getNamedAccounts()
const {deploy, log} = deployments
Expand Down
1 change: 1 addition & 0 deletions bridge/deploy/17_set_wrapped_currency.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const address = require('../hardhat/helper/address');
const {web3} = require("hardhat");

module.exports = async function (hre) { // HardhatRuntimeEnvironment
const {getNamedAccounts, deployments, network} = hre;
Expand Down
2 changes: 1 addition & 1 deletion bridge/deployed/deployHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function isMainnet(network) {

function isLocalNetwork(network) {
return !network.toLowerCase().includes('mainnet')
&& !network.toLowerCase().includes('kovan')
&& !network.toLowerCase().includes('goerli')
&& !network.toLowerCase().includes('testnet');
}

Expand Down
2 changes: 1 addition & 1 deletion bridge/deployed/kovan.json → bridge/deployed/goerli.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"network": "kovan",
"network": "goerli",
"MultiSig": "0x040007b1804ad78a97f541bebed377dcb60e4138",
"ProxyAdmin": "0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6",
"Utils": "0xE18b8fb2942493EA96BfC46a044e4F966f2dFaB6",
Expand Down
1 change: 1 addition & 0 deletions bridge/deployments/goerli/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
Loading