-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(light-client): Restrict lightClientUpdate function
- Loading branch information
Showing
4 changed files
with
68 additions
and
16 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
2 changes: 1 addition & 1 deletion
2
beacon-light-client/solidity/contracts/bridge/src/utils/LightClientUpdateVerifier.sol
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.9; | ||
pragma solidity 0.8.20; | ||
|
||
import './Verifier.sol'; | ||
|
||
|
41 changes: 41 additions & 0 deletions
41
beacon-light-client/solidity/tasks/change-adapter-address.ts
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,41 @@ | ||
import { task } from 'hardhat/config'; | ||
import { getGenericLogger } from '@dendreth/utils/ts-utils/logger'; | ||
import Web3 from 'web3'; | ||
import { publishTransaction } from '@dendreth/relay/implementations/publish_evm_transaction'; | ||
|
||
const logger = getGenericLogger(); | ||
|
||
task('change-adapter-address', 'Verify') | ||
.addParam('lightClient', 'The address of the BeaconLightClient contract') | ||
.addParam('adapter', 'The address of the adapter contract') | ||
.addParam( | ||
'transactionSpeed', | ||
'The speed you want the transactions to be included in a block', | ||
'avg', | ||
undefined, | ||
true, | ||
) | ||
.setAction(async (args, { network, ethers }) => { | ||
const [publisher] = await ethers.getSigners(); | ||
|
||
logger.info(`Changing adapter with address ${publisher.address}`); | ||
|
||
const lightClientContract = await ethers.getContractAt( | ||
'BeaconLightClient', | ||
args.lightClient, | ||
publisher, | ||
); | ||
|
||
const web3 = new Web3((network.config as any).url); | ||
|
||
await publishTransaction( | ||
lightClientContract, | ||
'changeAdapterAddress', | ||
[args.adapter], | ||
web3, | ||
args.transactionSpeed, | ||
true, | ||
); | ||
|
||
logger.info(`Adapter changed to ${args.adapter}`); | ||
}); |