Skip to content

Commit 8cf3e00

Browse files
authored
Unichain DUs (#231)
* Update dev-chain-init image build command in Readme. * Deploy unichain template + factory.
1 parent 0b51ee4 commit 8cf3e00

File tree

6 files changed

+2989
-1140
lines changed

6 files changed

+2989
-1140
lines changed

packages/config/src/networks.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"AMB": "0xaFA0dc5Ad21796C9106a36D68f69aAD69994BB64",
4646
"DataUnionFactory": "0x4A4c4759eb3b7ABee079f832850cD3D0dC48D927",
4747
"DataUnionTemplate": "0x36afc8c9283CC866b8EB6a61C6e6862a83cd6ee8",
48+
"UnichainDataUnionFactory": "0xd1FA6C06E1D838Bb989640A2C4b8a499FD0ab187",
49+
"UnichainDataUnionTemplate": "0xC2F87E37019e227F2Be5030aabBCc7eAF136e05c",
4850
"StorageNodeRegistry": "0x231b810D98702782963472e1D60a25496999E75D",
4951
"StreamRegistry": "0x6cCdd5d866ea766f6DF5965aA98DeCCD629ff222",
5052
"StreamStorageRegistry": "0xd04af489677001444280366Dd0885B03dAaDe71D",

packages/docker-dev-chain-init/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ Build and tag required docker images.
8080
2. git clone https://github.com/streamr-dev/tokenbridge-contracts.git; cd tokenbridge-contracts; docker build . -t 'streamr/tokenbridge-contracts'
8181

8282
To build images:
83-
./preload_parity_images.sh
83+
84+
From the root of the monorepo:
85+
./clean_and_preload_parity_images.sh
8486

8587
This will tag the images locally and echo the command to push to dockerhub.
8688
Note that you MUST remove the parity docker volumes to delete old chain data from docker and then restart `streamr-docker-dev` to see preload changes.

packages/docker-dev-chain-init/deploy_du2_factories.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const DataUnionFactorySidechain = require("./ethereumContractJSONs/DataUnionFact
1111
const DataUnionFactoryMainnet = require("./ethereumContractJSONs/DataUnionFactoryMainnet.json")
1212
const MainnetMigrationManager = require("./ethereumContractJSONs/MainnetMigrationManager.json")
1313
const SidechainMigrationManager = require("./ethereumContractJSONs/SidechainMigrationManager.json")
14+
// unichain
15+
const DataUnionFactory = require("./ethereumContractJSONs/DataUnionFactory.json")
16+
const DataUnionTemplate = require("./ethereumContractJSONs/DataUnionTemplate.json")
1417

1518
const log = process.env.QUIET ? (() => { }) : console.log // eslint-disable-line no-console
1619
// class LoggingProvider extends JsonRpcProvider {
@@ -97,6 +100,25 @@ async function deployDUFactories() {
97100
let factMainnet = await dtx.deployed()
98101
console.log(`factMainnet: ${factMainnet.address}`)
99102

103+
// Deploy unichain template + factory
104+
105+
log(`Deploying DU unichain template contract from ${wallet_home.address}`)
106+
deployer = new ContractFactory(DataUnionTemplate.abi, DataUnionTemplate.bytecode, wallet_home)
107+
dtx = await deployer.deploy(
108+
{ gasLimit: 6000000 }
109+
)
110+
const unichainTemplate = await dtx.deployed()
111+
console.log(`Unichain DataUnionTemplate: ${unichainTemplate.address}`)
112+
log(`Deploying DU unichain factory contract from ${wallet_home.address}`)
113+
deployer = new ContractFactory(DataUnionFactory.abi, DataUnionFactory.bytecode, wallet_home)
114+
dtx = await deployer.deploy(
115+
unichainTemplate.address,
116+
home_erc677,
117+
{ gasLimit: 6000000 }
118+
)
119+
120+
const unichainFactory = await dtx.deployed()
121+
console.log(`Unichain DataUnionFactory: ${unichainFactory.address}`)
100122
}
101123

102124
async function start() {

0 commit comments

Comments
 (0)