New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@keep-network/sortition-pools

Package Overview
Dependencies
Maintainers
5
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keep-network/sortition-pools - npm Package Compare versions

Comparing version 1.2.0-pre.4 to 1.2.0-pre.5

128

migrations/scripts/deployContracts.js
// Deploys contracts using truffle artifacts and deployer.
class SortitionPoolsDeployer {
constructor(deployer, artifacts) {
this.deployer = deployer
this.artifacts = artifacts
this.libs = {}
}
async deployLibraries() {
if (!this.libs.Branch) {
this.libs.Branch = this.artifacts.require("Branch")
await this.deployer.deploy(this.libs.Branch)
}
async function deployLibraries(artifacts, deployer) {
const Branch = artifacts.require("Branch")
const Position = artifacts.require("Position")
const StackLib = artifacts.require("StackLib")
const Leaf = artifacts.require("Leaf")
if (!this.libs.Position) {
this.libs.Position = this.artifacts.require("Position")
await this.deployer.deploy(this.libs.Position)
}
await deployer.deploy(Branch)
await deployer.deploy(Position)
await deployer.deploy(StackLib)
await deployer.link(Branch, Leaf)
await deployer.deploy(Leaf)
}
if (!this.libs.StackLib) {
this.libs.StackLib = this.artifacts.require("StackLib")
await this.deployer.deploy(this.libs.StackLib)
}
async function deploySortitionPoolFactory(artifacts, deployer) {
await deployLibraries(artifacts, deployer)
if (!this.libs.Leaf) {
this.libs.Leaf = this.artifacts.require("Leaf")
await this.deployer.link(this.libs.Branch, this.libs.Leaf)
await this.deployer.deploy(this.libs.Leaf)
}
}
const Branch = artifacts.require("Branch")
const Position = artifacts.require("Position")
const StackLib = artifacts.require("StackLib")
const Leaf = artifacts.require("Leaf")
async deploySortitionPoolFactory() {
await this.deployLibraries()
const SortitionPoolFactory = artifacts.require("SortitionPoolFactory")
const SortitionPoolFactory = this.artifacts.require("SortitionPoolFactory")
// Sortition Pool Factory
await deployer.link(Branch, SortitionPoolFactory)
await deployer.link(Position, SortitionPoolFactory)
await deployer.link(StackLib, SortitionPoolFactory)
await deployer.link(Leaf, SortitionPoolFactory)
await deployer.deploy(SortitionPoolFactory)
}
// Sortition Pool Factory
await this.deployer.link(this.libs.Branch, SortitionPoolFactory)
await this.deployer.link(this.libs.Position, SortitionPoolFactory)
await this.deployer.link(this.libs.StackLib, SortitionPoolFactory)
await this.deployer.link(this.libs.Leaf, SortitionPoolFactory)
await this.deployer.deploy(SortitionPoolFactory)
}
async function deployBondedSortitionPoolFactory(artifacts, deployer) {
await deployLibraries(artifacts, deployer)
async deployBondedSortitionPoolFactory() {
await this.deployLibraries()
const Branch = artifacts.require("Branch")
const Position = artifacts.require("Position")
const StackLib = artifacts.require("StackLib")
const Leaf = artifacts.require("Leaf")
const BondedSortitionPoolFactory = this.artifacts.require(
"BondedSortitionPoolFactory",
)
const BondedSortitionPoolFactory = artifacts.require(
"BondedSortitionPoolFactory",
)
// Bonded Sortition Pool Factory
await this.deployer.link(this.libs.Branch, BondedSortitionPoolFactory)
await this.deployer.link(this.libs.Position, BondedSortitionPoolFactory)
await this.deployer.link(this.libs.StackLib, BondedSortitionPoolFactory)
await this.deployer.link(this.libs.Leaf, BondedSortitionPoolFactory)
await this.deployer.deploy(BondedSortitionPoolFactory)
}
// Bonded Sortition Pool Factory
await deployer.link(Branch, BondedSortitionPoolFactory)
await deployer.link(Position, BondedSortitionPoolFactory)
await deployer.link(StackLib, BondedSortitionPoolFactory)
await deployer.link(Leaf, BondedSortitionPoolFactory)
await deployer.deploy(BondedSortitionPoolFactory)
}
async deployFullyBackedSortitionPoolFactory() {
await this.deployLibraries()
async function deployFullyBackedSortitionPoolFactory(artifacts, deployer) {
await deployLibraries(artifacts, deployer)
const FullyBackedSortitionPoolFactory = this.artifacts.require(
"FullyBackedSortitionPoolFactory",
)
const Branch = artifacts.require("Branch")
const Position = artifacts.require("Position")
const StackLib = artifacts.require("StackLib")
const Leaf = artifacts.require("Leaf")
// Fully Backed Sortition Pool Factory
await this.deployer.link(this.libs.Branch, FullyBackedSortitionPoolFactory)
await this.deployer.link(
this.libs.Position,
FullyBackedSortitionPoolFactory,
)
await this.deployer.link(
this.libs.StackLib,
FullyBackedSortitionPoolFactory,
)
await this.deployer.link(this.libs.Leaf, FullyBackedSortitionPoolFactory)
await this.deployer.deploy(FullyBackedSortitionPoolFactory)
}
const FullyBackedSortitionPoolFactory = artifacts.require(
"FullyBackedSortitionPoolFactory",
)
// Fully Backed Sortition Pool Factory
await deployer.link(Branch, FullyBackedSortitionPoolFactory)
await deployer.link(Position, FullyBackedSortitionPoolFactory)
await deployer.link(StackLib, FullyBackedSortitionPoolFactory)
await deployer.link(Leaf, FullyBackedSortitionPoolFactory)
await deployer.deploy(FullyBackedSortitionPoolFactory)
}
module.exports = SortitionPoolsDeployer
module.exports = {
deploySortitionPoolFactory,
deployBondedSortitionPoolFactory,
deployFullyBackedSortitionPoolFactory,
}
{
"name": "@keep-network/sortition-pools",
"version": "1.2.0-pre.4",
"version": "1.2.0-pre.5",
"description": "",

@@ -16,3 +16,3 @@ "main": "truffle-config.js",

"buidler-vm": "buidler node",
"buidler-vm:log": "buidler node | grep '^ \\|console.log'",
"buidler-vm:log": "buidler node | grep '^ \\|console.log'",
"test": "NODE_ENV=test truffle test",

@@ -19,0 +19,0 @@ "lint": "npm run lint:js && npm run lint:sol",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc