(facets)
| 226 | // Loop through each contract address in the facets |
| 227 | // query web3 api to get deployed bytecode |
| 228 | export async function getOnChainBytecodeFromFacets(facets) { |
| 229 | const deployedBytecode = {} |
| 230 | for (let contractAddress in facets) { |
| 231 | try { |
| 232 | // Fetch the bytecode of the contract |
| 233 | const bytecode = await ethers.provider.getCode(contractAddress) |
| 234 | deployedBytecode[bytecode] = contractAddress |
| 235 | // Log the bytecode to the console |
| 236 | } catch (error) { |
| 237 | // Print any errors to stderr |
| 238 | console.error( |
| 239 | `Error fetching bytecode for ${contractAddress}:`, |
| 240 | error.message, |
| 241 | ) |
| 242 | } |
| 243 | } |
| 244 | return deployedBytecode |
| 245 | } |
| 246 | |
| 247 | /** |
| 248 | * Filters the input array to only return strings that start with '0x'. |
no outgoing calls
no test coverage detected