Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set deposit limits script #67

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scripts/16_set-deposit-limit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const {
callTokenManagerFunction,
} = require('./helpers/10-call-token-manager-fn');

async function setDepositLimit(minOrMax, newLimit) {
scolear marked this conversation as resolved.
Show resolved Hide resolved
let functionToCall;
if (minOrMax === 'min') {
scolear marked this conversation as resolved.
Show resolved Hide resolved
functionToCall = 'setMinimumDeposit';
} else if (minOrMax === 'max') {
functionToCall = 'setMaximumDeposit';
} else {
throw new Error('Invalid minOrMax argument');
}
await callTokenManagerFunction(functionToCall, [newLimit]);
}

module.exports = setDepositLimit;

if (require.main === module) {
const minOrMax = process.argv[2];
const newLimit = process.argv[3];
setDepositLimit(minOrMax, newLimit).catch(console.error);
}
8 changes: 8 additions & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const tokenManagerSetupVault = require('./12_setup-vault');
const whitelistingEnabled = require('./13_set-whitelisting');
const setBtcFeeRecipient = require('./14_set-btc-fee-recipient');
const setBTCFee = require('./15_set-btc-fee');
const setDepositLimit = require('./16_set-deposit-limit');

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

Expand Down Expand Up @@ -182,6 +183,13 @@ async function main() {
.argument('<newFee>', 'new fee')
.action(setBTCFee);

program
.command('set-deposit-limit')
.description('[token-man] set Min/Max deposit limit')
.argument('<minOrMax>', 'min or max')
.argument('<newLimit>', 'new limit')
.action(setDepositLimit);

program
.command('create-dlc')
.description('[test] create a DLC')
Expand Down