-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Solidity source mapping from OpCodes at runtime! * Fix test failure introduced by upgrade of go-ethereum + bring new test code in line with implementation variable names. * Run prettier on Solidity test contract * Properly handle source-code resolution from EVM trace when executing libraries. * GitHub test Action is failing despite tests passing so attempting to change the node_modules cache key to clear it. * Revert GitHub Action cache key and change testing to non-verbose as it hides failures; also output `solc` + `abigen` versions. * Deliberate panic in ethier/gen.go to diagnose difference from local run to GitHub Actions * A further deliberate panic in ethier/gen.go to see full output; abigen differs and regexp is a bad idea here because it's too fragile * Update ethier/gen.go to match output of old and new versions of abigen after ethereum/go-ethereum#24835. See the TODO in ethier/gen.go re direct modification of the bind.Bind() template. * Simplify calculation of PUSH<N> instruction offset
- Loading branch information
1 parent
4411623
commit 61e3b3c
Showing
12 changed files
with
812 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ jobs: | |
sudo apt-get install -y solc abigen | ||
- name: Run tests | ||
run: npm run test:verbose | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* | ||
* Additional code added by ethier, beyond standard abigen output. | ||
* | ||
*/ | ||
|
||
const ( | ||
// SolCVersion is the version of the Solidity compiler used to create this | ||
// file. | ||
SolCVersion = {{quote .Version}} | ||
|
||
// CombinedJSON is the raw combined-JSON output of solc, passed to abigen to | ||
// create this file. | ||
CombinedJSON = {{quote .CombinedJSON}} | ||
) | ||
|
||
var ( | ||
// SourceList is the list of source files used by solc when compiling these | ||
// contracts. Their indices correspond to the file numbers in the source | ||
// maps. | ||
SourceList = {{stringSlice .SourceList}} | ||
|
||
// RuntimeSourceMaps contains, for each compiled contract, the runtime | ||
// binary and its associated source map. With a program counter pointing to | ||
// an instruction in the runtime binary, this is sufficient to determine the | ||
// respective location in the Solidity code from which the binary was | ||
// compiled. | ||
RuntimeSourceMaps = map[string]*compiler.Contract{ | ||
{{- range $src, $c := .Contracts }} | ||
{{quote (contract $src)}}: { | ||
RuntimeCode: {{quote $c.RuntimeCode}}, | ||
Info: compiler.ContractInfo{ | ||
SrcMapRuntime: {{quote $c.Info.SrcMapRuntime}}, | ||
}, | ||
}, | ||
{{- end }} | ||
} | ||
) | ||
|
||
// deployedContracts tracks which contract is deployed at each address. The | ||
// standard abigen Deploy<ContractName>() functions have been modified to set | ||
// the value of this map to <ContractName> before returning the deployment | ||
// address. This allows SourceMap() to function correctly. | ||
var deployedContracts = make(map[common.Address]string) | ||
|
||
// SourceMap returns a new SourceMap, able to convert program counters to | ||
// Solidity source offsets. SourceMap() must be called after contracts are | ||
// deployed otherwise they won't be registered by contract address (only by | ||
// contract name). | ||
func SourceMap() (*solidity.SourceMap, error) { | ||
return solidity.NewSourceMap(SourceList, RuntimeSourceMaps, deployedContracts) | ||
} |
Oops, something went wrong.