Skip to content

Commit

Permalink
Merge pull request #11 from lidofinance/develop
Browse files Browse the repository at this point in the history
Raw data
  • Loading branch information
avsetsin committed Oct 4, 2023
2 parents a60bdaa + eb74d4f commit 3b9c5d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion utils/call-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export const contractCallConfirm = async (contract: Contract, method: string, ar
const to = await contract.getAddress();

const parsedArgs = args.map((arg) => stringify(arg));
const call = `${method}(${parsedArgs})`;
const data = contract.interface.encodeFunctionData(method, args);

return confirmTx(network.name, from, to, `${method}(${parsedArgs})`);
return confirmTx(network.name, from, to, call, data);
};

export const populateGasLimit = async (contract: Contract, method: string, argsWithOverrides: unknown[]) => {
Expand Down
8 changes: 3 additions & 5 deletions utils/confirm-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import prompts from 'prompts';
const title = chalk.gray;
const value = chalk.blue.bold;

export const confirmTx = async (network: string, from: string, to: string, data?: string) => {
export const confirmTx = async (network: string, from: string, to: string, call: string, data: string) => {
console.log(title('chain:'), value(network));
console.log(title(' from:'), value(from));
console.log(title(' to:'), value(to));

if (data) {
console.log(title(' data:'), value(data));
}
console.log(title(' call:'), value(call));
console.log(title(' data:'), value(data));

const { confirm } = await prompts({
type: 'confirm',
Expand Down

0 comments on commit 3b9c5d6

Please sign in to comment.