-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to change admin of enterprise-versioning contract
- Loading branch information
Showing
8 changed files
with
108 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {MsgMigrateContract} from "@terra-money/terra.js"; | ||
import task, {info} from "@terra-money/terrariums"; | ||
|
||
const ENTERPRISE_VERSIONING = "enterprise-versioning"; | ||
|
||
task(async ({deployer, signer, refs, network}) => { | ||
// deployer.buildContract(ENTERPRISE); | ||
// deployer.optimizeContract(ENTERPRISE); | ||
// | ||
await deployer.storeCode(ENTERPRISE_VERSIONING); | ||
await new Promise((resolve) => setTimeout(resolve, 5000)); | ||
|
||
const contract = refs.getContract(network, ENTERPRISE_VERSIONING); | ||
|
||
let msg = new MsgMigrateContract( | ||
signer.key.accAddress, | ||
contract.address!, | ||
parseInt(contract.codeId!), | ||
{}, | ||
); | ||
|
||
try { | ||
let tx = await signer.createAndSignTx({ | ||
msgs: [msg], | ||
}); | ||
await signer.lcd.tx.broadcast(tx); | ||
info(`Migrated ${ENTERPRISE_VERSIONING} contract.`); | ||
} catch (e) { | ||
info(`Migrating ${ENTERPRISE_VERSIONING} contract has failed.`); | ||
info(JSON.stringify(e)); | ||
} | ||
|
||
refs.saveRefs(); | ||
}); |