You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* move etherscan utils from server to lib-sourcify
* enhance error handling for Etherscan and update related tests
* move stringToBase64 utility function from etherscan-util to etherscan.session.handlers
* refactor: reorganize Etherscan utilities and error handling for improved clarity and maintainability
* streamline Etherscan error handling by removing unnecessary parameters and enhancing error message generation
* simplify Etherscan error handling by removing URL parameters and enhancing error messages
* update dependencies and enhance test setup with chai-http
* test failing tests on circleci
* fix linter
* try disabling parallel mode on circleci
* disable concurrency in circleci test
* test fix circleci tests
* enhance error handling in fetchFromEtherscan and update test to focus on this function
* fix circleci tests by forcing the mocked api key to ''
* allow empty userApiKey in mockEtherscanApi
* Use etherscanResponseMock from server in lib-sourcify's tests
* remove AGENTS.md file
* small fixes
* add documentation and refactor code in server
* Rename `url` to `maskedUrl` following 0a417e6
* fix PR comments
* improve types in etherscan-util.ts
* fix conflicts on package-lock.json
---------
Co-authored-by: Kaan Uzdoğan <[email protected]>
content: "contract MyContract { function foo() public {} }",
64
+
'Contract.sol': {
65
+
content: 'contract MyContract { function foo() public {} }',
66
66
},
67
67
},
68
68
settings: {
@@ -71,35 +71,35 @@ const jsonInput = {
71
71
runs: 200,
72
72
},
73
73
outputSelection: {
74
-
"*": [],
74
+
'*': [],
75
75
},
76
76
},
77
77
} asSolidityJsonInput;
78
78
79
79
// Step 3: Create a compilation
80
80
const compilation =newSolidityCompilation(
81
81
solc,
82
-
"0.8.20", // compiler version
82
+
'0.8.20', // compiler version
83
83
jsonInput,
84
84
{
85
-
path: "Contract.sol",
86
-
name: "MyContract", // The name of your contract
87
-
}
85
+
path: 'Contract.sol',
86
+
name: 'MyContract', // The name of your contract
87
+
},
88
88
);
89
89
90
90
// Step 4: Set up a SourcifyChain instance
91
91
const myChain =newSourcifyChain({
92
-
name: "My EVM Chain",
92
+
name: 'My EVM Chain',
93
93
chainId: 1337,
94
-
rpc: ["http://localhost:8545"],
94
+
rpc: ['http://localhost:8545'],
95
95
supported: true,
96
96
});
97
97
98
98
// Step 5: Verify the contract
99
99
const verification =newVerification(
100
100
compilation,
101
101
myChain,
102
-
"0xc0ffee254729296a45a3885639AC7E10F9d54979"
102
+
'0xc0ffee254729296a45a3885639AC7E10F9d54979',
103
103
);
104
104
105
105
awaitverification.verify();
@@ -115,13 +115,16 @@ This example shows the complete verification flow for a Solidity contract using
115
115
For browser usage, we recommend using [web-solc](https://github.com/gnidan/web-solc) instead of `@ethereum-sourcify/compilers`. Here's an example of how to implement the `ISolidityCompiler` interface with `web-solc`:
lib-sourcify v2 consists of several key components:
137
140
138
141
-**Validation**: Based on a Solidity metadata.json file that describes a contract build, checks if all source files are present and valid. Fetches missing sources from IPFS if necessary.
139
-
140
142
-`SolidityMetadataContract`: Represents a Solidity contract with its metadata and source files
141
143
-`processFiles.ts`: Utility functions for creating `SolidityMetadataContract` instances from files
142
144
143
145
-**Compilation**: Handles contract compilation
144
-
145
146
-`AbstractCompilation`: Base class for compilation
0 commit comments