mirror of
https://github.com/logos-storage/logos-storage-contracts-eth.git
synced 2026-01-02 13:23:10 +00:00
Fix token deployment with contractAt
This commit is contained in:
parent
7cf952c63b
commit
ba0882077c
@ -39,6 +39,10 @@ Or you can you `npx` directly:
|
||||
npx hardhat ignition deploy ignition/modules/marketplace.js --network localhost
|
||||
```
|
||||
|
||||
To reuse a previously deployed `Token` contract, define the environment variable `TOKEN_ADDRESS`.
|
||||
The deployment script will use `contractAt` from Hardhat Ignition to retrieve the existing contract
|
||||
instead of deploying a new one.
|
||||
|
||||
Running the prover
|
||||
------------------
|
||||
|
||||
|
||||
@ -18,15 +18,13 @@ module.exports = buildModule("Marketplace", (m) => {
|
||||
const { verifier } = m.useModule(VerifierModule)
|
||||
const configuration = m.getParameter("configuration", getDefaultConfig())
|
||||
|
||||
let marketplace
|
||||
|
||||
if (process.env.TOKEN_ADDRESS) {
|
||||
marketplace = m.contractAt("TestToken", process.env.TOKEN_ADDRESS, {})
|
||||
} else {
|
||||
marketplace = m.contract("Marketplace", [configuration, token, verifier], {
|
||||
const marketplace = m.contract(
|
||||
"Marketplace",
|
||||
[configuration, token, verifier],
|
||||
{
|
||||
from: deployer,
|
||||
})
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
let testMarketplace
|
||||
const config = hre.network.config
|
||||
|
||||
@ -6,9 +6,15 @@ const MINTED_TOKENS = 1_000_000_000_000_000n
|
||||
module.exports = buildModule("Token", (m) => {
|
||||
const deployer = m.getAccount(0)
|
||||
|
||||
const token = m.contract("TestToken", [], {
|
||||
from: deployer,
|
||||
})
|
||||
let token
|
||||
|
||||
if (process.env.TOKEN_ADDRESS) {
|
||||
token = m.contractAt("TestToken", process.env.TOKEN_ADDRESS, {})
|
||||
} else {
|
||||
token = m.contract("TestToken", [], {
|
||||
from: deployer,
|
||||
})
|
||||
}
|
||||
|
||||
const config = hre.network.config
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user