Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit d8168b3

Browse files
committed
fix: logging
1 parent d39ea8c commit d8168b3

File tree

2 files changed

+18
-75
lines changed

2 files changed

+18
-75
lines changed

chainDeploy/helpers/logging.ts

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,37 +65,24 @@ export const prepareAndLogTransaction = async ({
6565
contractInstance,
6666
functionName,
6767
args,
68-
description,
69-
walletClient,
70-
inputs
68+
description
7169
}: PrepareAndLogTransactionParams) => {
72-
const account = await contractInstance.read.owner();
73-
const to = contractInstance.address;
7470
const data = encodeFunctionData({
7571
abi: contractInstance.abi,
7672
functionName,
7773
args
7874
});
7975

80-
const tx = await walletClient.prepareTransactionRequest({
81-
account,
82-
to,
83-
data
84-
});
85-
8676
addTransaction({
87-
to: tx.to,
88-
value: tx.value ? tx.value.toString() : "0",
89-
data: null,
90-
contractMethod: {
91-
inputs,
92-
name: functionName,
93-
payable: false
94-
},
95-
contractInputsValues: args.reduce((acc: any, arg: any, index: number) => {
96-
acc[inputs[index].name] = arg;
97-
return acc;
98-
}, {})
77+
to: contractInstance.address,
78+
value: "0",
79+
data: encodeFunctionData({
80+
abi: contractInstance.abi,
81+
functionName,
82+
args
83+
}),
84+
contractMethod: null,
85+
contractInputsValues: null
9986
});
10087

10188
logTransaction(description, data);

deploy/03-deploy-ctokens-set-extensions.ts

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments }) =>
6969
contractInstance: fuseFeeDistributor,
7070
functionName: "_setCErc20DelegateExtensions",
7171
args: [erc20Del.address as Address, [erc20Del.address as Address, cTokenFirstExtension.address as Address]],
72-
description: "Set CErc20Delegate Extensions",
73-
walletClient,
74-
inputs: [
75-
{ internalType: "address", name: "cErc20Delegate", type: "address" },
76-
{ internalType: "address[]", name: "extensions", type: "address[]" }
77-
]
72+
description: "Set CErc20Delegate Extensions"
7873
});
7974
} else {
8075
tx = await fuseFeeDistributor.write._setCErc20DelegateExtensions([
@@ -94,13 +89,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments }) =>
9489
contractInstance: fuseFeeDistributor,
9590
functionName: "_setLatestCErc20Delegate",
9691
args: [1, erc20Del.address as Address, becomeImplementationData],
97-
description: "Set Latest CErc20Delegate",
98-
walletClient,
99-
inputs: [
100-
{ internalType: "uint8", name: "delegateType", type: "uint8" },
101-
{ internalType: "address", name: "newImplementation", type: "address" },
102-
{ internalType: "bytes", name: "becomeImplementationData", type: "bytes" }
103-
]
92+
description: "Set Latest CErc20Delegate"
10493
});
10594
} else {
10695
tx = await fuseFeeDistributor.write._setLatestCErc20Delegate([
@@ -130,12 +119,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments }) =>
130119
erc20PluginDel.address as Address,
131120
[erc20PluginDel.address as Address, cTokenFirstExtension.address as Address]
132121
],
133-
description: "Set CErc20PluginDelegate Extensions",
134-
walletClient,
135-
inputs: [
136-
{ internalType: "address", name: "cErc20Delegate", type: "address" },
137-
{ internalType: "address[]", name: "extensions", type: "address[]" }
138-
]
122+
description: "Set CErc20PluginDelegate Extensions"
139123
});
140124
} else {
141125
tx = await fuseFeeDistributor.write._setCErc20DelegateExtensions([
@@ -156,13 +140,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments }) =>
156140
contractInstance: fuseFeeDistributor,
157141
functionName: "_setLatestCErc20Delegate",
158142
args: [2, erc20PluginDel.address as Address, becomeImplementationData],
159-
description: "Set Latest CErc20PluginDelegate",
160-
walletClient,
161-
inputs: [
162-
{ internalType: "uint8", name: "delegateType", type: "uint8" },
163-
{ internalType: "address", name: "newImplementation", type: "address" },
164-
{ internalType: "bytes", name: "becomeImplementationData", type: "bytes" }
165-
]
143+
description: "Set Latest CErc20PluginDelegate"
166144
});
167145
} else {
168146
tx = await fuseFeeDistributor.write._setLatestCErc20Delegate([
@@ -194,12 +172,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments }) =>
194172
erc20RewardsDel.address as Address,
195173
[erc20RewardsDel.address as Address, cTokenFirstExtension.address as Address]
196174
],
197-
description: "Set CErc20RewardsDelegate Extensions",
198-
walletClient,
199-
inputs: [
200-
{ internalType: "address", name: "cErc20Delegate", type: "address" },
201-
{ internalType: "address[]", name: "extensions", type: "address[]" }
202-
]
175+
description: "Set CErc20RewardsDelegate Extensions"
203176
});
204177
} else {
205178
tx = await fuseFeeDistributor.write._setCErc20DelegateExtensions([
@@ -219,13 +192,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments }) =>
219192
contractInstance: fuseFeeDistributor,
220193
functionName: "_setLatestCErc20Delegate",
221194
args: [3, erc20RewardsDel.address as Address, becomeImplementationData],
222-
description: "Set Latest CErc20RewardsDelegate",
223-
walletClient,
224-
inputs: [
225-
{ internalType: "uint8", name: "delegateType", type: "uint8" },
226-
{ internalType: "address", name: "newImplementation", type: "address" },
227-
{ internalType: "bytes", name: "becomeImplementationData", type: "bytes" }
228-
]
195+
description: "Set Latest CErc20RewardsDelegate"
229196
});
230197
} else {
231198
tx = await fuseFeeDistributor.write._setLatestCErc20Delegate([
@@ -260,12 +227,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments }) =>
260227
erc20PluginRewardsDel.address as Address,
261228
[erc20PluginRewardsDel.address as Address, cTokenFirstExtension.address as Address]
262229
],
263-
description: "Set CErc20PluginRewardsDelegate Extensions",
264-
walletClient,
265-
inputs: [
266-
{ internalType: "address", name: "cErc20Delegate", type: "address" },
267-
{ internalType: "address[]", name: "extensions", type: "address[]" }
268-
]
230+
description: "Set CErc20PluginRewardsDelegate Extensions"
269231
});
270232
} else {
271233
tx = await fuseFeeDistributor.write._setCErc20DelegateExtensions([
@@ -288,13 +250,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments }) =>
288250
contractInstance: fuseFeeDistributor,
289251
functionName: "_setLatestCErc20Delegate",
290252
args: [4, erc20PluginRewardsDel.address as Address, becomeImplementationData],
291-
description: "Set Latest CErc20PluginRewardsDelegate",
292-
walletClient,
293-
inputs: [
294-
{ internalType: "uint8", name: "delegateType", type: "uint8" },
295-
{ internalType: "address", name: "newImplementation", type: "address" },
296-
{ internalType: "bytes", name: "becomeImplementationData", type: "bytes" }
297-
]
253+
description: "Set Latest CErc20PluginRewardsDelegate"
298254
});
299255
} else {
300256
tx = await fuseFeeDistributor.write._setLatestCErc20Delegate([

0 commit comments

Comments
 (0)