开发者社区> 镜像站> NPM> @hyperdivision/eth-multisig-wallet
@hyperdivision/eth-multisig-wallet
Ethereum Multisig Wallet
Last updated 9 months ago by emilbayes .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @hyperdivision/eth-multisig-wallet 
SYNC missed versions from official npm registry.

eth-multisig-wallet

Build Status

Ethereum Multisig Wallet

Usage

const keygen = require('./lib/keygen')
const quorum = require('./lib/quorum-calc')
const signCall = require('./lib/wallet-sign')

const keypair = keygen()
const keypair2 = keygen()

const instance = await Wallet.new([keypair.address], quorum(0.5), quorum(0.5), quorum(0.5), quorum(0.5))

assert(await instance.isOwner.call(keypair.address) === true)
assert(await instance.isOwner.call(keypair2.address) === false)

const res = await instance.replaceOwner([
  signCall(
    0, // seq,
    instance.address,
    keypair,
    'replaceOwner',
    ['address', 'address'],
    [keypair.address, keypair2.address]
  )
], keypair.address, keypair2.address)

assert((await instance.seq.call()).toNumber() === 1)
assert(await instance.isOwner.call(keypair.address) === false)
assert(await instance.isOwner.call(keypair2.address) === true)

API

contract Wallet(address[] initialOwners, uint32 setQuorumQuorum, uint32 addOwnerQuorum, uint32 removeOwnerQuorum, uint32 replaceOwnerQuorum)

wallet.setQuorum(bytes[] signatures, string operation, uint32 minQuorum)

wallet.addOwner(bytes[] signatures, address owner)

wallet.removeOwner(bytes[] signatures, address owner)

wallet.replaceOwner(bytes[] signatures, address oldOwner, address newOwner)

License

ISC

Current Tags

  • 1.1.0                                ...           latest (9 months ago)

2 Versions

  • 1.1.0                                ...           9 months ago
  • 1.0.0                                ...           9 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 3
Dependencies (8)
Dev Dependencies (5)
Dependents (0)
None