Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## vNEXT
- Add `set-callback-gas.ts` script. (#121)
- Accept any signature format in `SignatureVerifier.v8` when the account is a smart contract. (#120)
- Update UML class diagrams. (#112)
- Generate Solidity documentation. (#111)
Expand Down
25 changes: 25 additions & 0 deletions scripts/set-callback-gas.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-FileCopyrightText: 2024 IEXEC BLOCKCHAIN TECH <contact@iex.ec>
// SPDX-License-Identifier: Apache-2.0

import hre, { deployments } from 'hardhat';
import { IexecAccessors__factory, IexecMaintenanceDelegate__factory } from '../typechain';

(async () => {
const requestedCallbackGas = Number(process.env.CALLBACK_GAS);
if (!requestedCallbackGas) {
console.error('`CALLBACK_GAS` env variable is missing. Aborting.');
process.exit(1);
}
console.log(`Setting callback-gas to ${requestedCallbackGas.toLocaleString()} ..`);
const [owner] = await hre.ethers.getSigners();
const erc1538ProxyAddress = (await deployments.get('ERC1538Proxy')).address;
const viewCallbackGas = async () =>
(await IexecAccessors__factory.connect(erc1538ProxyAddress, owner).callbackgas())
.toNumber()
.toLocaleString();
const callbackGasBefore = await viewCallbackGas();
await IexecMaintenanceDelegate__factory.connect(erc1538ProxyAddress, owner)
.setCallbackGas(requestedCallbackGas)
.then((tx) => tx.wait());
console.log(`Changed callback-gas from ${callbackGasBefore} to ${await viewCallbackGas()}`);
})().catch((error) => console.log(error));