Skip to content

Commit

Permalink
feat: add account 6,7,8 as signers
Browse files Browse the repository at this point in the history
  • Loading branch information
scolear committed May 29, 2024
1 parent 7bd627e commit df32442
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 524 deletions.
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ while ! grep -q "Started HTTP and WebSocket JSON-RPC server" hardhat.log; do
sleep 1
done

npx hardhat run --network localhost docker/scripts/deploy-all.js
CLI_MODE='noninteractive' npx hardhat run --network localhost docker/scripts/deploy-all.js

# push the message "Deployment Complete" into the log file
echo "Deployment Complete" >>hardhat.log
Expand Down
8 changes: 4 additions & 4 deletions docker/scripts/deploy-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const addSigner = require('../../scripts/00-grant-role-on-manager').addSigner;
const setWhitelisting = require('../../scripts/13_set-whitelisting');
const { loadContractAddress } = require('../../scripts/helpers/utils');

prompts.inject([true, true, true, true, true, true]);
process.env.CLI_MODE = 'noninteractive';

async function main() {
const network = hardhat.network.name;
Expand Down Expand Up @@ -42,9 +42,9 @@ async function main() {

// Adding signers
const defaultSigners = [
'0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
'0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
'0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc',
'0x976EA74026E726554dB657fA54763abd0C3a0aa9', // account[6]
'0x14dC79964da2C08b23698B3D3cc7Ca32193d9955', // account[7]
'0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f', // account[8]
];
for (const signer of defaultSigners) {
await addSigner(signer);
Expand Down
1 change: 0 additions & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ require('@openzeppelin/hardhat-upgrades');
require('@nomiclabs/hardhat-solhint');
require('solidity-coverage');
require('dotenv').config();
require('./scripts/tasks');

const arbitrumURL = process.env.ARB_NODE_ADDR ?? 'https://arb1.arbitrum.io/rpc';
const arbSepoliaURL =
Expand Down
53 changes: 29 additions & 24 deletions scripts/08-set-tss-commitment.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
loadDeploymentInfo,
} = require('./helpers/deployment-handlers_versioned');

async function setTSSCommitment() {
async function setTSSCommitment(timestamp) {
const accounts = await hardhat.ethers.getSigners();
const admin = accounts[0];
const deployInfo = await loadDeploymentInfo(
Expand All @@ -28,31 +28,35 @@ async function setTSSCommitment() {
);
console.log('Current Commitment (string): ', currentCommitment);

const response = await prompts({
type: 'select',
name: 'set-unset',
message: 'Do you want to set or unset the TSS commitment?',
choices: [
{ title: 'Set (to Timestamp)', value: 'set' },
{ title: 'Unset (to HashZero)', value: 'unset' },
],
});

let commitment, commitmentBytes32;

if (response['set-unset'] === 'unset') {
commitment = ethers.constants.HashZero;
commitmentBytes32 = ethers.constants.HashZero;
} else if (response['set-unset'] === 'set') {
// lets make the commitment a UNIX timestamp in seconds
commitment = Math.floor(Date.now() / 1000);
// Convert the number to a string and then to bytes32
commitmentBytes32 = ethers.utils.formatBytes32String(
commitment.toString()
);
if (timestamp) {
commitment = timestamp;
} else {
console.log('No action taken');
return;
const response = await prompts({
type: 'select',
name: 'set-unset',
message: 'Do you want to set or unset the TSS commitment?',
choices: [
{ title: 'Set (to Timestamp)', value: 'set' },
{ title: 'Unset (to HashZero)', value: 'unset' },
],
});

if (response['set-unset'] === 'unset') {
commitment = ethers.constants.HashZero;
commitmentBytes32 = ethers.constants.HashZero;
} else if (response['set-unset'] === 'set') {
// lets make the commitment a UNIX timestamp in seconds
commitment = Math.floor(Date.now() / 1000);
// Convert the number to a string and then to bytes32
commitmentBytes32 = ethers.utils.formatBytes32String(
commitment.toString()
);
} else {
console.log('No action taken');
return;
}
}

console.log('Commitment: ', commitment.toString());
Expand All @@ -64,5 +68,6 @@ async function setTSSCommitment() {
module.exports = setTSSCommitment;

if (require.main === module) {
setTSSCommitment().catch(console.error);
const timestamp = process.argv[2];
setTSSCommitment(timestamp).catch(console.error);
}
Loading

0 comments on commit df32442

Please sign in to comment.