Skip to content

Commit

Permalink
feat: enable PoR script (#123)
Browse files Browse the repository at this point in the history
* feat: enable PoR script

* fix: typo
  • Loading branch information
scolear authored Oct 22, 2024
1 parent f64c9a4 commit 4beb642
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/19_set-por-enabled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const {
callManagerContractFunction,
} = require('./helpers/00-call-dlc-manager-fn');

async function setPoREnabled(enabled) {
const toSet = enabled === 'true' ? true : false;
await callManagerContractFunction('setPorEnabled', [toSet]);
}

module.exports = setPoREnabled;

if (require.main === module) {
const enabled = process.argv[2];
setPoREnabled(enabled).catch(console.error);
}
7 changes: 7 additions & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const setBTCFee = require('./15_set-btc-fee');
const setDepositLimit = require('./16_set-deposit-limit');
const setMinterOrBurner = require('./17_set-minter-or-burner');
const withdraw = require('./18_withdraw');
const setPoREnabled = require('./19_set-por-enabled');

const contractAdmin = require('./50_contract-admin');

Expand Down Expand Up @@ -211,6 +212,12 @@ async function main() {
.argument('<amount>', 'amount to withdraw')
.action(withdraw);

program
.command('set-por-enabled')
.description('[admin] enable Proof of Reserve')
.argument('<por-enabled>', 'por enabled')
.action(setPoREnabled);

// The hardhat and getconfig modules both expect to be running from the root directory of the project,
// so we change the current directory to the parent dir of this script file to make things work
// even if you call dlc-link-eth from elsewhere
Expand Down

0 comments on commit 4beb642

Please sign in to comment.