-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into siliev/change-xchain-messages
- Loading branch information
Showing
88 changed files
with
2,030 additions
and
1,441 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
56 changes: 54 additions & 2 deletions
56
contracts/generated/ManagementContract/ManagementContract.go
Large diffs are not rendered by default.
Oops, something went wrong.
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,39 @@ | ||
import { ethers } from "hardhat"; | ||
import { ManagementContract } from "../../typechain-types"; | ||
|
||
const setChallengePeriod = async function (mgmtContractAddr: string, challengPeriod: number) { | ||
const managementContract = await ethers.getContractAt( | ||
"ManagementContract", | ||
mgmtContractAddr | ||
) as ManagementContract; | ||
|
||
|
||
console.log(`Setting challenge period to: ${challengPeriod}`); | ||
const tx = await managementContract.SetChallengePeriod(BigInt(challengPeriod)); | ||
await tx.wait(); | ||
console.log(`Successfully set challenge period to: ${challengPeriod}`); | ||
|
||
const mgmtContractChallengePeriod = await managementContract.GetChallengePeriod(); | ||
if (BigInt(challengPeriod) !== mgmtContractChallengePeriod) { | ||
throw new Error(`Failed to set the challenge period to: ${challengPeriod}. Returned value is: ${mgmtContractChallengePeriod}`); | ||
} | ||
} | ||
|
||
const mgmtContractAddr = process.env.MGMT_CONTRACT_ADDRESS; | ||
const challengePeriod = process.env.L1_CHALLENGE_PERIOD ? | ||
Number(process.env.L1_CHALLENGE_PERIOD) : 0; | ||
|
||
|
||
if (!mgmtContractAddr) { | ||
console.error("Missing required environment variables: MGMT_CONTRACT_ADDRESS"); | ||
process.exit(1); | ||
} | ||
|
||
setChallengePeriod(mgmtContractAddr, challengePeriod) | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); | ||
|
||
export default setChallengePeriod; |
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
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
Oops, something went wrong.