@bgd-labs/toolbox 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +49 -2
- package/dist/index.d.ts +49 -2
- package/dist/index.js +80 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +78 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -173,6 +173,10 @@ declare const HUMAN_READABLE_PAYLOAD_STATE: {
|
|
|
173
173
|
};
|
|
174
174
|
type PayloadsControllerContract = GetContractReturnType<typeof IPayloadsControllerCore_ABI, Client>;
|
|
175
175
|
declare function getPayloadsController<T extends Client>(client: T, address: Hex): PayloadsControllerContract;
|
|
176
|
+
declare function getPayloadStorageOverrides(client: TestClient, payloadsController: Address, payloadId: number): Promise<{
|
|
177
|
+
slot: `0x${string}`;
|
|
178
|
+
value: `0x${string}`;
|
|
179
|
+
}[]>;
|
|
176
180
|
declare function makePayloadExecutableOnTestClient(client: TestClient, payloadsController: Address, payloadId: number): Promise<void>;
|
|
177
181
|
declare function isPayloadFinal(state: PayloadState): boolean;
|
|
178
182
|
declare function getNonFinalizedPayloads<T extends Client>(client: T, payloadsController: Address): Promise<number[]>;
|
|
@@ -309,9 +313,52 @@ declare function tenderly_createVnet({ slug, displayName, baseChainId, forkChain
|
|
|
309
313
|
vnet: Tenderly_createVnetParamsResponse;
|
|
310
314
|
testClient: TestClient;
|
|
311
315
|
walletClient: WalletClient;
|
|
312
|
-
simulate: (body:
|
|
316
|
+
simulate: (body: object) => Promise<any>;
|
|
313
317
|
delete: () => Promise<Response>;
|
|
314
318
|
}>;
|
|
319
|
+
type StateObject = {
|
|
320
|
+
balance?: string;
|
|
321
|
+
code?: string;
|
|
322
|
+
storage?: Record<Hex, Hex>;
|
|
323
|
+
};
|
|
324
|
+
type ContractObject = {
|
|
325
|
+
contractName: string;
|
|
326
|
+
source: string;
|
|
327
|
+
sourcePath: string;
|
|
328
|
+
compiler: {
|
|
329
|
+
name: "solc";
|
|
330
|
+
version: string;
|
|
331
|
+
};
|
|
332
|
+
networks: Record<string, {
|
|
333
|
+
events?: Record<string, string>;
|
|
334
|
+
links?: Record<string, string>;
|
|
335
|
+
address: string;
|
|
336
|
+
transactionHash?: string;
|
|
337
|
+
}>;
|
|
338
|
+
};
|
|
339
|
+
type TenderlySimRequest = {
|
|
340
|
+
network_id: string;
|
|
341
|
+
block_number?: number;
|
|
342
|
+
transaction_index?: number;
|
|
343
|
+
from: Hex;
|
|
344
|
+
to: Hex;
|
|
345
|
+
input: Hex;
|
|
346
|
+
gas?: number;
|
|
347
|
+
gas_price?: string;
|
|
348
|
+
value?: string;
|
|
349
|
+
simulation_type?: "full" | "quick";
|
|
350
|
+
save?: boolean;
|
|
351
|
+
save_if_fails?: boolean;
|
|
352
|
+
state_objects?: Record<Hex, StateObject>;
|
|
353
|
+
contracts?: ContractObject[];
|
|
354
|
+
block_header?: {
|
|
355
|
+
number?: Hex;
|
|
356
|
+
timestamp?: Hex;
|
|
357
|
+
};
|
|
358
|
+
generate_access_list?: boolean;
|
|
359
|
+
root?: string;
|
|
360
|
+
};
|
|
361
|
+
declare function tenderly_sim({ accountSlug, projectSlug, accessToken }: TenderlyConfig, body: TenderlySimRequest): Promise<any>;
|
|
315
362
|
|
|
316
363
|
/**
|
|
317
364
|
* Returns the standardJsonInput format as consumed by most explorers
|
|
@@ -4945,4 +4992,4 @@ declare function renderTenderlyReport({ client, sim, }: RenderTenderlyReportPara
|
|
|
4945
4992
|
emitter: viem.Address;
|
|
4946
4993
|
}[]>;
|
|
4947
4994
|
|
|
4948
|
-
export { ChainId, ChainList, EVENT_DB, type ExplorerConfig, type FoundryStorage, type GovernanceContract, HALF_RAY, HALF_WAD, HUMAN_READABLE_PAYLOAD_STATE, HUMAN_READABLE_PROPOSAL_STATE, LTV_PRECISION, PayloadState, type PayloadsControllerContract, ProposalState, RAY, type ReserveConfiguration, SECONDS_PER_YEAR, SelfdestuctCheckState, type Storage, type StorageType, type Tenderly_createVnetParamsResponse, WAD, WAD_RAY_RATIO, alchemyNetworkMap, alchemySupportedChainIds, bitmapToIndexes, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateHealthFactorFromBalances, calculateLinearInterest, checkForSelfdestruct, decodeReserveConfiguration, decodeReserveConfigurationV2, decodeUserConfiguration, diffCode, diffFoundryStorageLayout, erc1967_AdminSlot, erc1967_ImplementationSlot, etherscanExplorers, foundry_getStandardJsonInput, foundry_getStorageLayout, getAlchemyRPC, getBits, getClient, getCurrentDebtBalance, getCurrentLiquidityBalance, getExplicitRPC, getExplorer, getGovernance, getMarketReferenceCurrencyAndUsdBalance, getNetworkEnv, getNonFinalizedPayloads, getNonFinalizedProposals, getNormalizedDebt, getNormalizedIncome, getPayloadsController, getPublicRpc, getQuicknodeRpc, getRPCUrl, getSourceCode, isPayloadFinal, isProposalFinal, makePayloadExecutableOnTestClient, makeProposalExecutableOnTestClient, parseEtherscanStyleSourceCode, parseLogs, publicRPCs, quicknodeNetworkMap, rayDiv, rayMul, rayToWad, renderTenderlyReport, routescanExplorers, setBits, tenderly_createVnet, tenderly_deleteVnet, tenderly_getVnet, tenderly_simVnet, wadDiv, wadToRay };
|
|
4995
|
+
export { ChainId, ChainList, type ContractObject, EVENT_DB, type ExplorerConfig, type FoundryStorage, type GovernanceContract, HALF_RAY, HALF_WAD, HUMAN_READABLE_PAYLOAD_STATE, HUMAN_READABLE_PROPOSAL_STATE, LTV_PRECISION, PayloadState, type PayloadsControllerContract, ProposalState, RAY, type ReserveConfiguration, SECONDS_PER_YEAR, SelfdestuctCheckState, type StateObject, type Storage, type StorageType, type TenderlySimRequest, type Tenderly_createVnetParamsResponse, WAD, WAD_RAY_RATIO, alchemyNetworkMap, alchemySupportedChainIds, bitmapToIndexes, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateHealthFactorFromBalances, calculateLinearInterest, checkForSelfdestruct, decodeReserveConfiguration, decodeReserveConfigurationV2, decodeUserConfiguration, diffCode, diffFoundryStorageLayout, erc1967_AdminSlot, erc1967_ImplementationSlot, etherscanExplorers, foundry_getStandardJsonInput, foundry_getStorageLayout, getAlchemyRPC, getBits, getClient, getCurrentDebtBalance, getCurrentLiquidityBalance, getExplicitRPC, getExplorer, getGovernance, getMarketReferenceCurrencyAndUsdBalance, getNetworkEnv, getNonFinalizedPayloads, getNonFinalizedProposals, getNormalizedDebt, getNormalizedIncome, getPayloadStorageOverrides, getPayloadsController, getPublicRpc, getQuicknodeRpc, getRPCUrl, getSourceCode, isPayloadFinal, isProposalFinal, makePayloadExecutableOnTestClient, makeProposalExecutableOnTestClient, parseEtherscanStyleSourceCode, parseLogs, publicRPCs, quicknodeNetworkMap, rayDiv, rayMul, rayToWad, renderTenderlyReport, routescanExplorers, setBits, tenderly_createVnet, tenderly_deleteVnet, tenderly_getVnet, tenderly_sim, tenderly_simVnet, wadDiv, wadToRay };
|
package/dist/index.d.ts
CHANGED
|
@@ -173,6 +173,10 @@ declare const HUMAN_READABLE_PAYLOAD_STATE: {
|
|
|
173
173
|
};
|
|
174
174
|
type PayloadsControllerContract = GetContractReturnType<typeof IPayloadsControllerCore_ABI, Client>;
|
|
175
175
|
declare function getPayloadsController<T extends Client>(client: T, address: Hex): PayloadsControllerContract;
|
|
176
|
+
declare function getPayloadStorageOverrides(client: TestClient, payloadsController: Address, payloadId: number): Promise<{
|
|
177
|
+
slot: `0x${string}`;
|
|
178
|
+
value: `0x${string}`;
|
|
179
|
+
}[]>;
|
|
176
180
|
declare function makePayloadExecutableOnTestClient(client: TestClient, payloadsController: Address, payloadId: number): Promise<void>;
|
|
177
181
|
declare function isPayloadFinal(state: PayloadState): boolean;
|
|
178
182
|
declare function getNonFinalizedPayloads<T extends Client>(client: T, payloadsController: Address): Promise<number[]>;
|
|
@@ -309,9 +313,52 @@ declare function tenderly_createVnet({ slug, displayName, baseChainId, forkChain
|
|
|
309
313
|
vnet: Tenderly_createVnetParamsResponse;
|
|
310
314
|
testClient: TestClient;
|
|
311
315
|
walletClient: WalletClient;
|
|
312
|
-
simulate: (body:
|
|
316
|
+
simulate: (body: object) => Promise<any>;
|
|
313
317
|
delete: () => Promise<Response>;
|
|
314
318
|
}>;
|
|
319
|
+
type StateObject = {
|
|
320
|
+
balance?: string;
|
|
321
|
+
code?: string;
|
|
322
|
+
storage?: Record<Hex, Hex>;
|
|
323
|
+
};
|
|
324
|
+
type ContractObject = {
|
|
325
|
+
contractName: string;
|
|
326
|
+
source: string;
|
|
327
|
+
sourcePath: string;
|
|
328
|
+
compiler: {
|
|
329
|
+
name: "solc";
|
|
330
|
+
version: string;
|
|
331
|
+
};
|
|
332
|
+
networks: Record<string, {
|
|
333
|
+
events?: Record<string, string>;
|
|
334
|
+
links?: Record<string, string>;
|
|
335
|
+
address: string;
|
|
336
|
+
transactionHash?: string;
|
|
337
|
+
}>;
|
|
338
|
+
};
|
|
339
|
+
type TenderlySimRequest = {
|
|
340
|
+
network_id: string;
|
|
341
|
+
block_number?: number;
|
|
342
|
+
transaction_index?: number;
|
|
343
|
+
from: Hex;
|
|
344
|
+
to: Hex;
|
|
345
|
+
input: Hex;
|
|
346
|
+
gas?: number;
|
|
347
|
+
gas_price?: string;
|
|
348
|
+
value?: string;
|
|
349
|
+
simulation_type?: "full" | "quick";
|
|
350
|
+
save?: boolean;
|
|
351
|
+
save_if_fails?: boolean;
|
|
352
|
+
state_objects?: Record<Hex, StateObject>;
|
|
353
|
+
contracts?: ContractObject[];
|
|
354
|
+
block_header?: {
|
|
355
|
+
number?: Hex;
|
|
356
|
+
timestamp?: Hex;
|
|
357
|
+
};
|
|
358
|
+
generate_access_list?: boolean;
|
|
359
|
+
root?: string;
|
|
360
|
+
};
|
|
361
|
+
declare function tenderly_sim({ accountSlug, projectSlug, accessToken }: TenderlyConfig, body: TenderlySimRequest): Promise<any>;
|
|
315
362
|
|
|
316
363
|
/**
|
|
317
364
|
* Returns the standardJsonInput format as consumed by most explorers
|
|
@@ -4945,4 +4992,4 @@ declare function renderTenderlyReport({ client, sim, }: RenderTenderlyReportPara
|
|
|
4945
4992
|
emitter: viem.Address;
|
|
4946
4993
|
}[]>;
|
|
4947
4994
|
|
|
4948
|
-
export { ChainId, ChainList, EVENT_DB, type ExplorerConfig, type FoundryStorage, type GovernanceContract, HALF_RAY, HALF_WAD, HUMAN_READABLE_PAYLOAD_STATE, HUMAN_READABLE_PROPOSAL_STATE, LTV_PRECISION, PayloadState, type PayloadsControllerContract, ProposalState, RAY, type ReserveConfiguration, SECONDS_PER_YEAR, SelfdestuctCheckState, type Storage, type StorageType, type Tenderly_createVnetParamsResponse, WAD, WAD_RAY_RATIO, alchemyNetworkMap, alchemySupportedChainIds, bitmapToIndexes, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateHealthFactorFromBalances, calculateLinearInterest, checkForSelfdestruct, decodeReserveConfiguration, decodeReserveConfigurationV2, decodeUserConfiguration, diffCode, diffFoundryStorageLayout, erc1967_AdminSlot, erc1967_ImplementationSlot, etherscanExplorers, foundry_getStandardJsonInput, foundry_getStorageLayout, getAlchemyRPC, getBits, getClient, getCurrentDebtBalance, getCurrentLiquidityBalance, getExplicitRPC, getExplorer, getGovernance, getMarketReferenceCurrencyAndUsdBalance, getNetworkEnv, getNonFinalizedPayloads, getNonFinalizedProposals, getNormalizedDebt, getNormalizedIncome, getPayloadsController, getPublicRpc, getQuicknodeRpc, getRPCUrl, getSourceCode, isPayloadFinal, isProposalFinal, makePayloadExecutableOnTestClient, makeProposalExecutableOnTestClient, parseEtherscanStyleSourceCode, parseLogs, publicRPCs, quicknodeNetworkMap, rayDiv, rayMul, rayToWad, renderTenderlyReport, routescanExplorers, setBits, tenderly_createVnet, tenderly_deleteVnet, tenderly_getVnet, tenderly_simVnet, wadDiv, wadToRay };
|
|
4995
|
+
export { ChainId, ChainList, type ContractObject, EVENT_DB, type ExplorerConfig, type FoundryStorage, type GovernanceContract, HALF_RAY, HALF_WAD, HUMAN_READABLE_PAYLOAD_STATE, HUMAN_READABLE_PROPOSAL_STATE, LTV_PRECISION, PayloadState, type PayloadsControllerContract, ProposalState, RAY, type ReserveConfiguration, SECONDS_PER_YEAR, SelfdestuctCheckState, type StateObject, type Storage, type StorageType, type TenderlySimRequest, type Tenderly_createVnetParamsResponse, WAD, WAD_RAY_RATIO, alchemyNetworkMap, alchemySupportedChainIds, bitmapToIndexes, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateHealthFactorFromBalances, calculateLinearInterest, checkForSelfdestruct, decodeReserveConfiguration, decodeReserveConfigurationV2, decodeUserConfiguration, diffCode, diffFoundryStorageLayout, erc1967_AdminSlot, erc1967_ImplementationSlot, etherscanExplorers, foundry_getStandardJsonInput, foundry_getStorageLayout, getAlchemyRPC, getBits, getClient, getCurrentDebtBalance, getCurrentLiquidityBalance, getExplicitRPC, getExplorer, getGovernance, getMarketReferenceCurrencyAndUsdBalance, getNetworkEnv, getNonFinalizedPayloads, getNonFinalizedProposals, getNormalizedDebt, getNormalizedIncome, getPayloadStorageOverrides, getPayloadsController, getPublicRpc, getQuicknodeRpc, getRPCUrl, getSourceCode, isPayloadFinal, isProposalFinal, makePayloadExecutableOnTestClient, makeProposalExecutableOnTestClient, parseEtherscanStyleSourceCode, parseLogs, publicRPCs, quicknodeNetworkMap, rayDiv, rayMul, rayToWad, renderTenderlyReport, routescanExplorers, setBits, tenderly_createVnet, tenderly_deleteVnet, tenderly_getVnet, tenderly_sim, tenderly_simVnet, wadDiv, wadToRay };
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,7 @@ __export(index_exports, {
|
|
|
77
77
|
getNonFinalizedProposals: () => getNonFinalizedProposals,
|
|
78
78
|
getNormalizedDebt: () => getNormalizedDebt,
|
|
79
79
|
getNormalizedIncome: () => getNormalizedIncome,
|
|
80
|
+
getPayloadStorageOverrides: () => getPayloadStorageOverrides,
|
|
80
81
|
getPayloadsController: () => getPayloadsController,
|
|
81
82
|
getPublicRpc: () => getPublicRpc,
|
|
82
83
|
getQuicknodeRpc: () => getQuicknodeRpc,
|
|
@@ -99,6 +100,7 @@ __export(index_exports, {
|
|
|
99
100
|
tenderly_createVnet: () => tenderly_createVnet,
|
|
100
101
|
tenderly_deleteVnet: () => tenderly_deleteVnet,
|
|
101
102
|
tenderly_getVnet: () => tenderly_getVnet,
|
|
103
|
+
tenderly_sim: () => tenderly_sim,
|
|
102
104
|
tenderly_simVnet: () => tenderly_simVnet,
|
|
103
105
|
wadDiv: () => wadDiv,
|
|
104
106
|
wadToRay: () => wadToRay
|
|
@@ -1961,28 +1963,43 @@ function getPayloadsController(client, address) {
|
|
|
1961
1963
|
address
|
|
1962
1964
|
});
|
|
1963
1965
|
}
|
|
1964
|
-
async function
|
|
1966
|
+
async function getPayloadStorageOverrides(client, payloadsController, payloadId) {
|
|
1965
1967
|
const controllerContract = getPayloadsController(client, payloadsController);
|
|
1966
1968
|
const payload = await controllerContract.read.getPayloadById([payloadId]);
|
|
1967
1969
|
const currentBlock = await (0, import_actions.getBlock)(client);
|
|
1968
|
-
return
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1970
|
+
return [
|
|
1971
|
+
{
|
|
1972
|
+
slot: getSolidityStorageSlotUint(3n, BigInt(payloadId)),
|
|
1973
|
+
value: (0, import_viem2.encodePacked)(
|
|
1974
|
+
["uint40", "uint40", "uint8", "uint8", "address"],
|
|
1975
|
+
[
|
|
1976
|
+
// we subtract 240n(4min), as tenderly might have been fallen behind
|
|
1977
|
+
// therefore using block_number -1 (latest on tenderly) and a 4min margin should give a save margin
|
|
1978
|
+
Number(currentBlock.timestamp - BigInt(payload.delay) - 1n - 240n),
|
|
1979
|
+
// altering queued time so can be executed in current block
|
|
1980
|
+
payload.createdAt,
|
|
1981
|
+
2 /* Queued */,
|
|
1982
|
+
payload.maximumAccessLevelRequired,
|
|
1983
|
+
payload.creator
|
|
1984
|
+
]
|
|
1985
|
+
)
|
|
1986
|
+
}
|
|
1987
|
+
];
|
|
1988
|
+
}
|
|
1989
|
+
async function makePayloadExecutableOnTestClient(client, payloadsController, payloadId) {
|
|
1990
|
+
const overrides = await getPayloadStorageOverrides(
|
|
1991
|
+
client,
|
|
1992
|
+
payloadsController,
|
|
1993
|
+
payloadId
|
|
1994
|
+
);
|
|
1995
|
+
for (const { slot, value } of overrides) {
|
|
1996
|
+
await client.setStorageAt({
|
|
1997
|
+
address: payloadsController,
|
|
1998
|
+
// 3 is the slot of the payloads mapping
|
|
1999
|
+
index: slot,
|
|
2000
|
+
value
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
1986
2003
|
}
|
|
1987
2004
|
function isPayloadFinal(state) {
|
|
1988
2005
|
return ![2 /* Queued */, 1 /* Created */].includes(state);
|
|
@@ -2970,7 +2987,7 @@ async function tenderly_deleteVnet(vnetId, { accountSlug, projectSlug, accessTok
|
|
|
2970
2987
|
);
|
|
2971
2988
|
}
|
|
2972
2989
|
async function tenderly_simVnet(vnetId, { accountSlug, projectSlug, accessToken }, body) {
|
|
2973
|
-
|
|
2990
|
+
const response = await fetch(
|
|
2974
2991
|
// Note: this is subject to change and currently uses the internal api of tenderly
|
|
2975
2992
|
`${TENDERLY_BASE_URL}/account/${accountSlug}/project/${projectSlug}/testnet/${vnetId}/simulate`,
|
|
2976
2993
|
{
|
|
@@ -2981,7 +2998,8 @@ async function tenderly_simVnet(vnetId, { accountSlug, projectSlug, accessToken
|
|
|
2981
2998
|
"X-Access-Key": accessToken
|
|
2982
2999
|
})
|
|
2983
3000
|
}
|
|
2984
|
-
)
|
|
3001
|
+
);
|
|
3002
|
+
return response.json();
|
|
2985
3003
|
}
|
|
2986
3004
|
async function tenderly_getVnet(slug, { accountSlug, projectSlug, accessToken }) {
|
|
2987
3005
|
return (await fetch(
|
|
@@ -3040,7 +3058,7 @@ async function tenderly_createVnet({
|
|
|
3040
3058
|
)).json();
|
|
3041
3059
|
}
|
|
3042
3060
|
let response = await createVnet();
|
|
3043
|
-
if (response.error?.slug === "
|
|
3061
|
+
if (response.error?.slug === "conflict" && force) {
|
|
3044
3062
|
const staleVnet = await tenderly_getVnet(slug, {
|
|
3045
3063
|
accessToken,
|
|
3046
3064
|
accountSlug,
|
|
@@ -3057,16 +3075,19 @@ async function tenderly_createVnet({
|
|
|
3057
3075
|
console.info(response.error);
|
|
3058
3076
|
throw new Error("Tenderly vnet could not be created");
|
|
3059
3077
|
}
|
|
3078
|
+
const rpc = response.rpcs.find(
|
|
3079
|
+
(r) => r.name.includes("Admin") && r.url.includes("https://")
|
|
3080
|
+
);
|
|
3060
3081
|
return {
|
|
3061
3082
|
vnet: response,
|
|
3062
3083
|
testClient: (0, import_viem4.createTestClient)({
|
|
3063
3084
|
mode: "tenderly",
|
|
3064
|
-
transport: (0, import_viem4.http)(
|
|
3085
|
+
transport: (0, import_viem4.http)(rpc.url)
|
|
3065
3086
|
}),
|
|
3066
3087
|
walletClient: (0, import_viem4.createWalletClient)({
|
|
3067
3088
|
chain: { id: forkChainId },
|
|
3068
3089
|
account: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
|
|
3069
|
-
transport: (0, import_viem4.http)(
|
|
3090
|
+
transport: (0, import_viem4.http)(rpc.url)
|
|
3070
3091
|
}),
|
|
3071
3092
|
simulate: (body2) => tenderly_simVnet(
|
|
3072
3093
|
response.id,
|
|
@@ -3075,7 +3096,17 @@ async function tenderly_createVnet({
|
|
|
3075
3096
|
accountSlug,
|
|
3076
3097
|
projectSlug
|
|
3077
3098
|
},
|
|
3078
|
-
|
|
3099
|
+
{
|
|
3100
|
+
...body2,
|
|
3101
|
+
network_id: baseChainId.toString(),
|
|
3102
|
+
block_number: null,
|
|
3103
|
+
transaction_index: 0,
|
|
3104
|
+
gas_price: "0",
|
|
3105
|
+
access_list: [],
|
|
3106
|
+
generate_access_list: true,
|
|
3107
|
+
save: true,
|
|
3108
|
+
source: "dashboard"
|
|
3109
|
+
}
|
|
3079
3110
|
),
|
|
3080
3111
|
delete: () => tenderly_deleteVnet(response.id, {
|
|
3081
3112
|
accessToken,
|
|
@@ -3084,6 +3115,28 @@ async function tenderly_createVnet({
|
|
|
3084
3115
|
})
|
|
3085
3116
|
};
|
|
3086
3117
|
}
|
|
3118
|
+
async function tenderly_sim({ accountSlug, projectSlug, accessToken }, body) {
|
|
3119
|
+
const response = await fetch(
|
|
3120
|
+
// Note: this is subject to change and currently uses the internal api of tenderly
|
|
3121
|
+
`${TENDERLY_BASE_URL}/account/${accountSlug}/project/${projectSlug}/simulate`,
|
|
3122
|
+
{
|
|
3123
|
+
method: "POST",
|
|
3124
|
+
body: JSON.stringify({
|
|
3125
|
+
generate_access_list: true,
|
|
3126
|
+
save: true,
|
|
3127
|
+
gas_price: "0",
|
|
3128
|
+
gas: 3e7,
|
|
3129
|
+
force_import_contracts: true,
|
|
3130
|
+
...body
|
|
3131
|
+
}),
|
|
3132
|
+
headers: new Headers({
|
|
3133
|
+
"Content-Type": "application/json",
|
|
3134
|
+
"X-Access-Key": accessToken
|
|
3135
|
+
})
|
|
3136
|
+
}
|
|
3137
|
+
);
|
|
3138
|
+
return response.json();
|
|
3139
|
+
}
|
|
3087
3140
|
|
|
3088
3141
|
// src/ecosystem/foundry.ts
|
|
3089
3142
|
var import_node_child_process = require("child_process");
|
|
@@ -3738,6 +3791,7 @@ async function renderTenderlyReport({
|
|
|
3738
3791
|
getNonFinalizedProposals,
|
|
3739
3792
|
getNormalizedDebt,
|
|
3740
3793
|
getNormalizedIncome,
|
|
3794
|
+
getPayloadStorageOverrides,
|
|
3741
3795
|
getPayloadsController,
|
|
3742
3796
|
getPublicRpc,
|
|
3743
3797
|
getQuicknodeRpc,
|
|
@@ -3760,6 +3814,7 @@ async function renderTenderlyReport({
|
|
|
3760
3814
|
tenderly_createVnet,
|
|
3761
3815
|
tenderly_deleteVnet,
|
|
3762
3816
|
tenderly_getVnet,
|
|
3817
|
+
tenderly_sim,
|
|
3763
3818
|
tenderly_simVnet,
|
|
3764
3819
|
wadDiv,
|
|
3765
3820
|
wadToRay
|