Skip to content

JavaScript version of Clones.predictDeterministicAddress from OpenZeppelin

License

Notifications You must be signed in to change notification settings

LuKks/predict-deterministic-address

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

predict-deterministic-address

JavaScript version of Clones.predictDeterministicAddress from OpenZeppelin

npm i predict-deterministic-address

Usage

const predictDeterministicAddress = require('predict-deterministic-address')

const implementation = '0xb148d3c611eB4D3dEB1b2Cc30337cAbDF9F7f722'
const deployer = '0x6a6Fd2c12d89F06251643Cc61e5e52Cef1E1304A'

const salt1 = '0x0000000000000000000000000000000000000000000000000000000000000000'
console.log(predictDeterministicAddress(implementation, salt1, deployer))
// => 0x58A273e0F6871fA5D78c580A68061c85c27E7D96

const salt2 = '0x0000000000000000000000000000000000000000000000000000000000000001'
console.log(predictDeterministicAddress(implementation, salt2, deployer))
// => 0xdc86A379DCCEdB006A7C26A7FC94513FF6c51Ba7

API

const address = predictDeterministicAddress(implementation, salt, deployer)

Computes the address of a clone deployed using Clones.cloneDeterministic from OpenZeppelin.

License

MIT

About

JavaScript version of Clones.predictDeterministicAddress from OpenZeppelin

Resources

License

Stars

Watchers

Forks

Packages

No packages published