Skip to content
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
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@

Ren has two repositories for its Solidity contract:

- [`darknode-sol`](https://github.com/renproject/darknode-sol) - contracts on Ethereum for managing darknode registrations.
- `gateway-sol` (this repository) - contracts on multiple EVM chains for minting and burning of ren-assets.
- [`darknode-sol`](https://github.com/renproject/darknode-sol) - contracts on Ethereum for managing darknode registrations.
- `gateway-sol` (this repository) - contracts on multiple EVM chains for minting and burning of ren-assets.

## ~ [Documentation](https://renproject.github.io/ren-client-docs/contracts/) ~

- For the latest contract addresses, see the [contract addresses](https://renproject.github.io/ren-client-docs/contracts/deployments) page.
- For a summary of each contract, see the [summary of contracts](https://renproject.github.io/ren-client-docs/contracts/summary) page.
- For the latest contract addresses, see the [contract addresses](https://renproject.github.io/ren-client-docs/contracts/deployments) page.
- For a summary of each contract, see the [summary of contracts](https://renproject.github.io/ren-client-docs/contracts/summary) page.

## Contract summary

There are three core layers in the gateway-sol contracts:

- **GatewayRegistry** - responsible for deploying and tracking gateway and asset instances
- **RenAsset** - ERC20s backed 1:1 by a corresponding asset on another chain. e.g. renDAI on Fantom is backed by DAI on Ethereum
- **Gateways** - responsible for minting and burning (_MintGateway_) and locking and releasing (_LockGateway_) Ren assets.
- **GatewayRegistry** - responsible for deploying and tracking gateway and asset instances
- **RenAsset** - ERC20s backed 1:1 by a corresponding asset on another chain. e.g. renDAI on Fantom is backed by DAI on Ethereum
- **Gateways** - responsible for minting and burning (_MintGateway_) and locking and releasing (_LockGateway_) Ren assets.

![gateway-sol diagram](https://user-images.githubusercontent.com/2221955/137038758-bbdba875-d73d-445b-8c81-76eec038a02d.png)

For example, minting renDAI on Fantom backed by DAI on Ethereum involves the following contracts:

- On Ethereum:
- The Ethereum GatewayRegistry
- A DAI LockGateway
- On Fantom:
- The Fantom GatewayRegistry
- A DAI MintGateway
- A renDAI RenAsset
- On Ethereum:
- The Ethereum GatewayRegistry
- A DAI LockGateway
- On Fantom:
- The Fantom GatewayRegistry
- A DAI MintGateway
- A renDAI RenAsset

<details>

Expand Down
53 changes: 53 additions & 0 deletions deploy/001_deploy_multisig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import chalk from "chalk";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { ConsoleInterface, updateLogger } from "./deploymentUtils/general";
import { Multisig } from "./deploymentUtils/multisig";
import { NetworkConfig, networks } from "./networks";

export const deployProtocol = async function (
hre: HardhatRuntimeEnvironment,
config?: NetworkConfig,
logger: ConsoleInterface = console
) {
// if (true as boolean) {
// return;
// }
logger = updateLogger(logger);

const { ethers, getNamedAccounts, network } = hre;
const { deployer } = await getNamedAccounts();

const { chainId } = await ethers.provider.getNetwork();

logger.log(chalk.green(`\n\nRunning deployment 001 (MultiSig) on ${network.name}...`));

config = config || networks[network.name as "hardhat"];
if (!config) {
throw new Error(`No network configuration found for ${network.name}!`);
}

logger.group("MultiSig");
let multisig: Multisig = new Multisig(hre, network.name, chainId, logger);

try {
await multisig.load();
if (multisig.safeSdk) {
logger.log(`Loaded Multisig at address ${multisig.getAddress()}`);
}
} catch (error) {
logger.log(`Deploying Multisig...`);
await multisig.deploy([deployer, ...config.multisigSigners], 1);
if (multisig.safeSdk) {
logger.log(`Deployed Multisig at address ${multisig.getAddress()}`);
}
}

logger.groupEnd();
};

export default async function func(env: HardhatRuntimeEnvironment): Promise<void | boolean> {
await deployProtocol(env);
}

func.tags = ["Multisig"];
Loading