@streamr/network-contracts
Advanced tools
Comparing version 7.0.4 to 7.0.5
@@ -1,6 +0,13 @@ | ||
import { Wallet, providers } from "ethers"; | ||
import { DefaultDelegationPolicy, DefaultLeavePolicy, DefaultExchangeRatePolicy, DefaultUndelegationPolicy, MaxOperatorsJoinPolicy, Operator, OperatorContractOnlyJoinPolicy, OperatorFactory, Sponsorship, SponsorshipFactory, StakeWeightedAllocationPolicy, StreamRegistry, StreamrConfig, TestToken, VoteKickPolicy } from "./exports"; | ||
import { Contract, Wallet, providers } from "ethers"; | ||
import { DefaultDelegationPolicy, DefaultLeavePolicy, DefaultExchangeRatePolicy, DefaultUndelegationPolicy, ENSCacheV2, MaxOperatorsJoinPolicy, NodeRegistry, Operator, OperatorContractOnlyJoinPolicy, OperatorFactory, Sponsorship, SponsorshipFactory, StakeWeightedAllocationPolicy, StreamRegistry, StreamStorageRegistry, StreamrConfig, TestToken, VoteKickPolicy } from "./exports"; | ||
export declare type StreamrContractAddresses = { | ||
"DATA": string; | ||
"ENS": string; | ||
"FIFSRegistrar": string; | ||
"PublicResolver": string; | ||
"TrackerRegistry": string; | ||
"StorageNodeRegistry": string; | ||
"StreamRegistry": string; | ||
"ENSCacheV2": string; | ||
"StreamStorageRegistry": string; | ||
"StreamrConfig": string; | ||
@@ -20,3 +27,10 @@ "SponsorshipFactory": string; | ||
"DATA": TestToken; | ||
"ENS": Contract; | ||
"FIFSRegistrar": Contract; | ||
"publicResolver": Contract; | ||
"trackerRegistry": NodeRegistry; | ||
"storageNodeRegistry": NodeRegistry; | ||
"streamRegistry": StreamRegistry; | ||
"eNSCacheV2": ENSCacheV2; | ||
"streamStorageRegistry": StreamStorageRegistry; | ||
"streamrConfig": StreamrConfig; | ||
@@ -47,5 +61,10 @@ "sponsorshipFactory": SponsorshipFactory; | ||
constructor(key: string, chainEndpointUrl: string); | ||
deployEnvironment(): Promise<void>; | ||
deployEnvironment({ deployToken }?: { | ||
deployToken?: boolean | undefined; | ||
}): Promise<void>; | ||
createFundStakeSponsorshipAndOperator(): Promise<void>; | ||
deployToken(): Promise<void>; | ||
deployEns(): Promise<void>; | ||
registerEnsName(domain: string, newOwner: Wallet): Promise<void>; | ||
deployRegistries(): Promise<void>; | ||
createStream(streampath: string): Promise<void>; | ||
@@ -60,2 +79,3 @@ deploySponsorshipFactory(): Promise<void>; | ||
flagVoteWithdraw(flagger: Operator, target: Operator, voter: Operator): Promise<void>; | ||
preloadDATAToken(): Promise<void>; | ||
} |
@@ -16,3 +16,2 @@ "use strict"; | ||
this.preloadedDATAWallets = []; | ||
this.streamId = "0xc2a02b33544cabd20b26e8f05ac14d04e3376055/testStream"; // mumbai | ||
this.provider = new ethers_1.providers.JsonRpcProvider(chainEndpointUrl); | ||
@@ -22,21 +21,16 @@ this.adminWallet = new ethers_1.Wallet(key, this.provider); | ||
this.contracts = {}; | ||
this.streamId = ""; | ||
} | ||
async deployEnvironment() { | ||
this.addresses.StreamRegistry = "0x4F0779292bd0aB33B9EBC1DBE8e0868f3940E3F2"; // mumbai | ||
// this.addresses.StreamRegistry = "0x231b810D98702782963472e1D60a25496999E75D" | ||
this.contracts.streamRegistry = new ethers_1.Contract(this.addresses.StreamRegistry, exports_1.streamRegistryABI, this.adminWallet); | ||
await this.contracts.streamRegistry.deployed(); | ||
log("stream exists: " + await this.contracts.streamRegistry.exists(this.streamId)); | ||
this.addresses.DATA = "0x53d8268307c6EE131AafDe5E6FD3575bADbB3D20"; // mumbai | ||
// this.addresses.DATA = "0xAf71Ee871ff1a374F88D6Ff01Cd618cE85127e78" | ||
this.contracts.DATA = new ethers_1.Contract(this.addresses.DATA, exports_1.tokenABI, this.adminWallet); | ||
await this.contracts.DATA.deployed(); | ||
// await this.deployEns() | ||
// await this.deployRegistries() | ||
async deployEnvironment({ deployToken = true } = {}) { | ||
if (deployToken) { | ||
await this.deployToken(); | ||
} | ||
await this.deployEns(); | ||
await this.deployRegistries(); | ||
await this.deploySponsorshipFactory(); | ||
await this.deployOperatorFactory(); | ||
// await this.preloadDATAToken() | ||
await this.preloadDATAToken(); | ||
} | ||
async createFundStakeSponsorshipAndOperator() { | ||
// await this.createStream("/testStream") | ||
await this.createStream("/testStream"); | ||
await this.deployNewSponsorship(); | ||
@@ -47,6 +41,4 @@ await this.sponsorNewSponsorship(); | ||
await this.stakeIntoSponsorship(); | ||
const preloadedWallet2 = new ethers_1.Wallet("0x4059de411f15511a85ce332e7a428f36492ab4e87c7830099dadbf130f1896ae", this.provider); | ||
const preloadedWallet3 = new ethers_1.Wallet("0x633a182fb8975f22aaad41e9008cb49a432e9fdfef37f151e9e7c54e96258ef9", this.provider); | ||
const operator2 = await this.deployOperatorContract(preloadedWallet2); // flagger | ||
const operator3 = await this.deployOperatorContract(preloadedWallet3); // target | ||
const operator2 = await this.deployOperatorContract(this.preloadedDATAWallets[2]); // flagger | ||
const operator3 = await this.deployOperatorContract(this.preloadedDATAWallets[3]); // target | ||
await this.flagVoteWithdraw(operator2, operator3, this.operator); | ||
@@ -62,121 +54,108 @@ } | ||
} | ||
// async deployEns(): Promise<void> { | ||
// log("Deploying ENS") | ||
// const ensDeploy = new ContractFactory(ensRegistryABI, ensRegistryBytecode, this.adminWallet) | ||
// const ensDeployTx = await ensDeploy.deploy() | ||
// this.contracts.ENS = await ensDeployTx.deployed() | ||
// this.addresses.ENS = this.contracts.ENS.address | ||
// log(`ENS registry deployed at ${this.contracts.ENS.address}`) | ||
// const rootNode = "eth" | ||
// const rootNodeNamehash = ethers.utils.namehash(rootNode) | ||
// const rootNodeSha3 = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(rootNode)) | ||
// const fifsDeploy = new ContractFactory(fifsRegistrarABI, fifsRegistrarBytecode, this.adminWallet) | ||
// const fifsDeployTx = await fifsDeploy.deploy(this.contracts.ENS.address, rootNodeNamehash) | ||
// this.contracts.FIFSRegistrar = await fifsDeployTx.deployed() | ||
// this.addresses.FIFSRegistrar = this.contracts.FIFSRegistrar.address | ||
// log(`FIFSRegistrar deployed at ${this.contracts.FIFSRegistrar.address}`) | ||
// await(await this.contracts.ENS.setSubnodeOwner("0x0000000000000000000000000000000000000000000000000000000000000000", | ||
// rootNodeSha3, this.contracts.FIFSRegistrar.address)).wait() | ||
// const resDeploy = new ContractFactory(publicResolverABI, publicResolverBytecode, this.adminWallet) | ||
// const resDeployTx = await resDeploy.deploy(this.contracts.ENS.address) | ||
// this.contracts.publicResolver = await resDeployTx.deployed() | ||
// this.addresses.PublicResolver = this.contracts.publicResolver.address | ||
// log(`PublicResolver deployed at ${this.contracts.publicResolver.address}`) | ||
// } | ||
// async registerEnsName(domain: string, newOwner: Wallet): Promise<void> { | ||
// newOwner = newOwner.connect(this.provider) | ||
// await (await this.adminWallet.sendTransaction({to: newOwner.address, value: ethers.utils.parseEther("1")})).wait() | ||
// const ensName = domain + ".eth" | ||
// const hashedDomain = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(domain)) | ||
// const nameHashedENSName = ethers.utils.namehash(ensName) | ||
// let tx = await this.contracts.FIFSRegistrar.register(hashedDomain, newOwner.address) | ||
// await tx.wait() | ||
// log("setting owner (" + newOwner.address + "), resolver and ttl for ens") | ||
// tx = await this.contracts.ENS.connect(newOwner) | ||
// .setRecord(nameHashedENSName, newOwner.address, this.addresses.PublicResolver, BigInt(100000000)) | ||
// await tx.wait() | ||
// } | ||
// async deployRegistries(): Promise<void> { | ||
// log("Deploying Registries") | ||
// log("Deploying NodeRegistry contract 1 (tracker registry)") | ||
// const initialTrackerNodes = [] | ||
// const initialTrackerMetadata = [] | ||
// initialTrackerNodes.push("0xb9e7cEBF7b03AE26458E32a059488386b05798e8") | ||
// initialTrackerMetadata.push("{\"ws\": \"ws://10.200.10.1:30301\", \"http\": \"http://10.200.10.1:30301\"}") | ||
// initialTrackerNodes.push("0x0540A3e144cdD81F402e7772C76a5808B71d2d30") | ||
// initialTrackerMetadata.push("{\"ws\": \"ws://10.200.10.1:30302\", \"http\": \"http://10.200.10.1:30302\"}") | ||
// initialTrackerNodes.push("0xf2C195bE194a2C91e93Eacb1d6d55a00552a85E2") | ||
// initialTrackerMetadata.push("{\"ws\": \"ws://10.200.10.1:30303\", \"http\": \"http://10.200.10.1:30303\"}") | ||
// const nodeRegistryFactory = new ContractFactory(nodeRegistryABI, nodeRegistryBytecode, this.adminWallet) | ||
// const trackerRegDeployTx = await nodeRegistryFactory.deploy() | ||
// const trackerRegistry = await trackerRegDeployTx.deployed() as NodeRegistry | ||
// await (await trackerRegistry.initialize(this.adminWallet.address, false, initialTrackerNodes, initialTrackerMetadata)).wait() | ||
// this.addresses.TrackerRegistry = trackerRegistry.address | ||
// this.contracts.trackerRegistry = trackerRegistry | ||
// log(`TrackerNodeRegistry deployed at ${trackerRegistry.address}`) | ||
// const nodes = await trackerRegistry.getNodes() | ||
// log(`TrackerNodeRegistry nodes : ${JSON.stringify(nodes)}`) | ||
// log("Deploying NodeRegistry contract 2 (storage node registry)") | ||
// const initialStorageNodes = [] | ||
// const initialStorageMetadata = [] | ||
// initialStorageNodes.push("0xde1112f631486CfC759A50196853011528bC5FA0") | ||
// initialStorageMetadata.push("{\"http\": \"http://10.200.10.1:8891\"}") | ||
// const nodeRegistry = await nodeRegistryFactory.deploy() as NodeRegistry | ||
// await nodeRegistry.deployed() | ||
// await (await nodeRegistry.initialize(this.adminWallet.address, false, initialStorageNodes, initialStorageMetadata)).wait() | ||
// this.addresses.StorageNodeRegistry = nodeRegistry.address | ||
// this.contracts.storageNodeRegistry = nodeRegistry | ||
// log(`StorageNodeRegistry deployed at ${this.addresses.StorageNodeRegistry}`) | ||
// const streamRegistryFactory = new ContractFactory(streamRegistryABI, streamRegistryBytecode, this.adminWallet) | ||
// const streamRegistry = await streamRegistryFactory.deploy() as StreamRegistry | ||
// await streamRegistry.deployed() | ||
// await (await streamRegistry.initialize( | ||
// Wallet.createRandom().address, | ||
// Wallet.createRandom().address | ||
// )).wait() | ||
// this.addresses.StreamRegistry = streamRegistry.address | ||
// this.contracts.streamRegistry = streamRegistry | ||
// log(`streamRegistry address ${this.addresses.StreamRegistry}`) | ||
// const storageNodePk = "0xaa7a3b3bb9b4a662e756e978ad8c6464412e7eef1b871f19e5120d4747bce966" | ||
// const storageNodeWallet = new ethers.Wallet(storageNodePk, this.provider) | ||
// const streamRegistry2 = streamRegistry.connect(storageNodeWallet) | ||
// // log("Create storage node assignment stream") | ||
// // const storageNodeAssignmentPath = "/assignments" | ||
// // const storageNodeAssignmentsStreamId = "0xde1112f631486cfc759a50196853011528bc5fa0/assignments" | ||
// // await (await streamRegistry2.createStream(storageNodeAssignmentPath, JSON.stringify({ partitions: 1}))).wait() | ||
// // await (await streamRegistry2.setPublicPermission(storageNodeAssignmentsStreamId, | ||
// // ethers.constants.MaxUint256, ethers.constants.MaxUint256)).wait() | ||
// // log("Storage node assignment stream created: " + storageNodeAssignmentsStreamId) | ||
// const scriptKeyAddress = "0xa3d1F77ACfF0060F7213D7BF3c7fEC78df847De1" | ||
// const ensCacheV2Factory = new ContractFactory(ENSCacheV2ABI, ENSCacheV2Bytecode, this.adminWallet) | ||
// const ensCacheV2 = await ensCacheV2Factory.deploy() as ENSCacheV2 | ||
// await ensCacheV2.deployed() | ||
// await (await ensCacheV2.initialize( | ||
// scriptKeyAddress, | ||
// streamRegistry.address, | ||
// ethers.constants.AddressZero, // # ENSCacheV1, do we need this in dev env? | ||
// )).wait() | ||
// this.addresses.ENSCacheV2 = ensCacheV2.address | ||
// this.contracts.eNSCacheV2 = ensCacheV2 | ||
// log(`ENSCacheV2 address ${this.addresses.ENSCacheV2}`) | ||
// const role = await streamRegistry.TRUSTED_ROLE() | ||
// log(`granting trusted role ${role} to self ${this.adminWallet.address}`) | ||
// await (await streamRegistry.grantRole(role, this.adminWallet.address)).wait() | ||
// log("setting ENSCache address in StreamRegistry") | ||
// await (await streamRegistry.setEnsCache(ensCacheV2.address)).wait() | ||
// log(`granting trusted role ${role} ensaddress ${ensCacheV2.address}`) | ||
// await (await streamRegistry.grantRole(role, ensCacheV2.address)).wait() | ||
// log("ensCacheScript address set as trusted role in streamregistry") | ||
// const streamStorageRegistryFactory = new ContractFactory(streamStorageRegistryABI, streamStorageRegistryBytecode, this.adminWallet) | ||
// const streamStorageRegistry = await streamStorageRegistryFactory.deploy() as StreamStorageRegistry | ||
// await streamStorageRegistry.deployed() | ||
// await (await streamStorageRegistry.initialize( | ||
// streamRegistry.address, | ||
// nodeRegistry.address, | ||
// ethers.constants.AddressZero | ||
// )).wait() | ||
// this.addresses.StreamStorageRegistry = streamStorageRegistry.address | ||
// this.contracts.streamStorageRegistry = streamStorageRegistry | ||
// log(`streamStorageRegistry address ${this.addresses.StreamStorageRegistry}`) | ||
// } | ||
async deployEns() { | ||
log("Deploying ENS"); | ||
const ensDeploy = new ethers_1.ContractFactory(exports_1.ensRegistryABI, exports_1.ensRegistryBytecode, this.adminWallet); | ||
const ensDeployTx = await ensDeploy.deploy(); | ||
this.contracts.ENS = await ensDeployTx.deployed(); | ||
this.addresses.ENS = this.contracts.ENS.address; | ||
log(`ENS registry deployed at ${this.contracts.ENS.address}`); | ||
const rootNode = "eth"; | ||
const rootNodeNamehash = ethers_1.ethers.utils.namehash(rootNode); | ||
const rootNodeSha3 = ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes(rootNode)); | ||
const fifsDeploy = new ethers_1.ContractFactory(exports_1.fifsRegistrarABI, exports_1.fifsRegistrarBytecode, this.adminWallet); | ||
const fifsDeployTx = await fifsDeploy.deploy(this.contracts.ENS.address, rootNodeNamehash); | ||
this.contracts.FIFSRegistrar = await fifsDeployTx.deployed(); | ||
this.addresses.FIFSRegistrar = this.contracts.FIFSRegistrar.address; | ||
log(`FIFSRegistrar deployed at ${this.contracts.FIFSRegistrar.address}`); | ||
await (await this.contracts.ENS.setSubnodeOwner("0x0000000000000000000000000000000000000000000000000000000000000000", rootNodeSha3, this.contracts.FIFSRegistrar.address)).wait(); | ||
const resDeploy = new ethers_1.ContractFactory(exports_1.publicResolverABI, exports_1.publicResolverBytecode, this.adminWallet); | ||
const resDeployTx = await resDeploy.deploy(this.contracts.ENS.address); | ||
this.contracts.publicResolver = await resDeployTx.deployed(); | ||
this.addresses.PublicResolver = this.contracts.publicResolver.address; | ||
log(`PublicResolver deployed at ${this.contracts.publicResolver.address}`); | ||
} | ||
async registerEnsName(domain, newOwner) { | ||
newOwner = newOwner.connect(this.provider); | ||
await (await this.adminWallet.sendTransaction({ to: newOwner.address, value: ethers_1.ethers.utils.parseEther("1") })).wait(); | ||
const ensName = domain + ".eth"; | ||
const hashedDomain = ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes(domain)); | ||
const nameHashedENSName = ethers_1.ethers.utils.namehash(ensName); | ||
let tx = await this.contracts.FIFSRegistrar.register(hashedDomain, newOwner.address); | ||
await tx.wait(); | ||
log("setting owner (" + newOwner.address + "), resolver and ttl for ens"); | ||
tx = await this.contracts.ENS.connect(newOwner) | ||
.setRecord(nameHashedENSName, newOwner.address, this.addresses.PublicResolver, BigInt(100000000)); | ||
await tx.wait(); | ||
} | ||
async deployRegistries() { | ||
log("Deploying Registries"); | ||
log("Deploying NodeRegistry contract 1 (tracker registry)"); | ||
const initialTrackerNodes = []; | ||
const initialTrackerMetadata = []; | ||
initialTrackerNodes.push("0xb9e7cEBF7b03AE26458E32a059488386b05798e8"); | ||
initialTrackerMetadata.push("{\"ws\": \"ws://10.200.10.1:30301\", \"http\": \"http://10.200.10.1:30301\"}"); | ||
initialTrackerNodes.push("0x0540A3e144cdD81F402e7772C76a5808B71d2d30"); | ||
initialTrackerMetadata.push("{\"ws\": \"ws://10.200.10.1:30302\", \"http\": \"http://10.200.10.1:30302\"}"); | ||
initialTrackerNodes.push("0xf2C195bE194a2C91e93Eacb1d6d55a00552a85E2"); | ||
initialTrackerMetadata.push("{\"ws\": \"ws://10.200.10.1:30303\", \"http\": \"http://10.200.10.1:30303\"}"); | ||
const nodeRegistryFactory = new ethers_1.ContractFactory(exports_1.nodeRegistryABI, exports_1.nodeRegistryBytecode, this.adminWallet); | ||
const trackerRegDeployTx = await nodeRegistryFactory.deploy(); | ||
const trackerRegistry = await trackerRegDeployTx.deployed(); | ||
await (await trackerRegistry.initialize(this.adminWallet.address, false, initialTrackerNodes, initialTrackerMetadata)).wait(); | ||
this.addresses.TrackerRegistry = trackerRegistry.address; | ||
this.contracts.trackerRegistry = trackerRegistry; | ||
log(`TrackerNodeRegistry deployed at ${trackerRegistry.address}`); | ||
const nodes = await trackerRegistry.getNodes(); | ||
log(`TrackerNodeRegistry nodes : ${JSON.stringify(nodes)}`); | ||
log("Deploying NodeRegistry contract 2 (storage node registry)"); | ||
const initialStorageNodes = []; | ||
const initialStorageMetadata = []; | ||
initialStorageNodes.push("0xde1112f631486CfC759A50196853011528bC5FA0"); | ||
initialStorageMetadata.push("{\"http\": \"http://10.200.10.1:8891\"}"); | ||
const nodeRegistry = await nodeRegistryFactory.deploy(); | ||
await nodeRegistry.deployed(); | ||
await (await nodeRegistry.initialize(this.adminWallet.address, false, initialStorageNodes, initialStorageMetadata)).wait(); | ||
this.addresses.StorageNodeRegistry = nodeRegistry.address; | ||
this.contracts.storageNodeRegistry = nodeRegistry; | ||
log(`StorageNodeRegistry deployed at ${this.addresses.StorageNodeRegistry}`); | ||
const streamRegistryFactory = new ethers_1.ContractFactory(exports_1.streamRegistryABI, exports_1.streamRegistryBytecode, this.adminWallet); | ||
const streamRegistry = await streamRegistryFactory.deploy(); | ||
await streamRegistry.deployed(); | ||
await (await streamRegistry.initialize(ethers_1.Wallet.createRandom().address, ethers_1.Wallet.createRandom().address)).wait(); | ||
this.addresses.StreamRegistry = streamRegistry.address; | ||
this.contracts.streamRegistry = streamRegistry; | ||
log(`streamRegistry address ${this.addresses.StreamRegistry}`); | ||
const storageNodePk = "0xaa7a3b3bb9b4a662e756e978ad8c6464412e7eef1b871f19e5120d4747bce966"; | ||
const storageNodeWallet = new ethers_1.ethers.Wallet(storageNodePk, this.provider); | ||
const streamRegistry2 = streamRegistry.connect(storageNodeWallet); | ||
log("Create storage node assignment stream"); | ||
const storageNodeAssignmentPath = "/assignments"; | ||
const storageNodeAssignmentsStreamId = "0xde1112f631486cfc759a50196853011528bc5fa0/assignments"; | ||
await (await streamRegistry2.createStream(storageNodeAssignmentPath, JSON.stringify({ partitions: 1 }))).wait(); | ||
await (await streamRegistry2.setPublicPermission(storageNodeAssignmentsStreamId, ethers_1.ethers.constants.MaxUint256, ethers_1.ethers.constants.MaxUint256)).wait(); | ||
log("Storage node assignment stream created: " + storageNodeAssignmentsStreamId); | ||
const scriptKeyAddress = "0xa3d1F77ACfF0060F7213D7BF3c7fEC78df847De1"; | ||
const ensCacheV2Factory = new ethers_1.ContractFactory(exports_1.ENSCacheV2ABI, exports_1.ENSCacheV2Bytecode, this.adminWallet); | ||
const ensCacheV2 = await ensCacheV2Factory.deploy(); | ||
await ensCacheV2.deployed(); | ||
await (await ensCacheV2.initialize(scriptKeyAddress, streamRegistry.address, ethers_1.ethers.constants.AddressZero)).wait(); | ||
this.addresses.ENSCacheV2 = ensCacheV2.address; | ||
this.contracts.eNSCacheV2 = ensCacheV2; | ||
log(`ENSCacheV2 address ${this.addresses.ENSCacheV2}`); | ||
const role = await streamRegistry.TRUSTED_ROLE(); | ||
log(`granting trusted role ${role} to self ${this.adminWallet.address}`); | ||
await (await streamRegistry.grantRole(role, this.adminWallet.address)).wait(); | ||
log("setting ENSCache address in StreamRegistry"); | ||
await (await streamRegistry.setEnsCache(ensCacheV2.address)).wait(); | ||
log(`granting trusted role ${role} ensaddress ${ensCacheV2.address}`); | ||
await (await streamRegistry.grantRole(role, ensCacheV2.address)).wait(); | ||
log("ensCacheScript address set as trusted role in streamregistry"); | ||
const streamStorageRegistryFactory = new ethers_1.ContractFactory(exports_1.streamStorageRegistryABI, exports_1.streamStorageRegistryBytecode, this.adminWallet); | ||
const streamStorageRegistry = await streamStorageRegistryFactory.deploy(); | ||
await streamStorageRegistry.deployed(); | ||
await (await streamStorageRegistry.initialize(streamRegistry.address, nodeRegistry.address, ethers_1.ethers.constants.AddressZero)).wait(); | ||
this.addresses.StreamStorageRegistry = streamStorageRegistry.address; | ||
this.contracts.streamStorageRegistry = streamStorageRegistry; | ||
log(`streamStorageRegistry address ${this.addresses.StreamStorageRegistry}`); | ||
} | ||
async createStream(streampath) { | ||
@@ -196,3 +175,2 @@ log(`creating stream ${streampath}`); | ||
log(`streamrConfig address ${streamrConfig.address}`); | ||
log(`setting streamRegistry address ${this.addresses.StreamRegistry}`); | ||
await (await streamrConfig.setStreamRegistryAddress(this.addresses.StreamRegistry)).wait(); | ||
@@ -364,3 +342,24 @@ const maxOperatorsJoinPolicy = await (new ethers_1.ContractFactory(exports_1.maxOperatorsJoinPolicyABI, exports_1.maxOperatorsJoinPolicyBytecode, this.adminWallet)).deploy(); | ||
} | ||
async preloadDATAToken() { | ||
const preloadAmount = ethers_1.ethers.utils.parseEther("1000000"); | ||
const preloadPrivkeys = [ | ||
"0x5e98cce00cff5dea6b454889f359a4ec06b9fa6b88e9d69b86de8e1c81887da0", | ||
"0xe5af7834455b7239881b85be89d905d6881dcb4751063897f12be1b0dd546bdb", | ||
"0x4059de411f15511a85ce332e7a428f36492ab4e87c7830099dadbf130f1896ae", | ||
"0x633a182fb8975f22aaad41e9008cb49a432e9fdfef37f151e9e7c54e96258ef9", | ||
"0x957a8212980a9a39bf7c03dcbeea3c722d66f2b359c669feceb0e3ba8209a297", | ||
"0xfe1d528b7e204a5bdfb7668a1ed3adfee45b4b96960a175c9ef0ad16dd58d728", | ||
"0xd7609ae3a29375768fac8bc0f8c2f6ac81c5f2ffca2b981e6cf15460f01efe14", | ||
"0xb1abdb742d3924a45b0a54f780f0f21b9d9283b231a0a0b35ce5e455fa5375e7", | ||
"0x2cd9855d17e01ce041953829398af7e48b24ece04ff9d0e183414de54dc52285" | ||
]; | ||
for (const preloadPrivkey of preloadPrivkeys) { | ||
const preloadWallet = new ethers_1.Wallet(preloadPrivkey, this.provider); | ||
this.preloadedDATAWallets.push(preloadWallet); | ||
const preloadAddress = preloadWallet.address; | ||
log(`preloading ${preloadAmount} DATA to ${preloadAddress}`); | ||
await (await this.contracts.DATA.mint(preloadAddress, preloadAmount)).wait(); | ||
} | ||
} | ||
} | ||
exports.StreamrEnvDeployer = StreamrEnvDeployer; |
{ | ||
"name": "@streamr/network-contracts", | ||
"version": "7.0.4", | ||
"version": "7.0.5", | ||
"description": "Smart contracts for Streamr Network", | ||
@@ -19,3 +19,2 @@ "author": "Streamr Network AG <contact@streamr.network>", | ||
"build": "rm -rf artifacts && hardhat compile && rm -rf dist && tsc -p tsconfig.build.json && ./generateSelectorsTxt.sh", | ||
"tsc": "tsc -p tsconfig.build.json", | ||
"clean": "rm -rf artifacts dist cache coverage typechain deployments .openzeppelin/unknown-31337.json", | ||
@@ -22,0 +21,0 @@ "test": "npm run test:fast && npm run test:slow", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3793662
54158