Add TOKEN_ADDRESS to reuse the token contract deployed

This commit is contained in:
Arnaud 2025-05-22 19:52:41 +02:00
parent 70433f1bde
commit 7cf952c63b
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F

View File

@ -18,13 +18,15 @@ module.exports = buildModule("Marketplace", (m) => {
const { verifier } = m.useModule(VerifierModule)
const configuration = m.getParameter("configuration", getDefaultConfig())
const marketplace = m.contract(
"Marketplace",
[configuration, token, verifier],
{
let marketplace
if (process.env.TOKEN_ADDRESS) {
marketplace = m.contractAt("TestToken", process.env.TOKEN_ADDRESS, {})
} else {
marketplace = m.contract("Marketplace", [configuration, token, verifier], {
from: deployer,
},
)
})
}
let testMarketplace
const config = hre.network.config