-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime-sdk/modules/evm: Do not zeroize query caller in new contracts
- Loading branch information
Showing
12 changed files
with
280 additions
and
5 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
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
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
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,6 @@ | ||
contract = query.sol | ||
abi = query.abi | ||
hex = query.hex | ||
|
||
include ../contracts.mk | ||
|
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 @@ | ||
[{"inputs":[],"name":"test","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] |
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,36 @@ | ||
package query | ||
|
||
import ( | ||
_ "embed" | ||
"encoding/hex" | ||
"fmt" | ||
"strings" | ||
|
||
ethABI "github.com/ethereum/go-ethereum/accounts/abi" | ||
) | ||
|
||
// CompiledHex is the compiled subcall contract in hex encoding. | ||
// | ||
//go:embed query.hex | ||
var CompiledHex string | ||
|
||
// Compiled is the compiled subcall contract. | ||
var Compiled = func() []byte { | ||
contract, err := hex.DecodeString(strings.TrimSpace(CompiledHex)) | ||
if err != nil { | ||
panic(fmt.Errorf("failed to decode contract: %w", err)) | ||
} | ||
return contract | ||
}() | ||
|
||
//go:embed query.abi | ||
var abiJSON string | ||
|
||
// ABI is the ABI of the subcall contract. | ||
var ABI = func() ethABI.ABI { | ||
abi, err := ethABI.JSON(strings.NewReader(abiJSON)) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return abi | ||
}() |
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 @@ | ||
6080604052348015600e575f80fd5b50607380601a5f395ff3fe6080604052348015600e575f80fd5b50600436106026575f3560e01c8063f8a8fd6d14602a575b5f80fd5b6040805133815290519081900360200190f3fea264697066735822122069b1e1d9de371cfb51fb1b110da57496602eb6086d8ec235c6da9ff09739c12764736f6c63430008150033 |
Oops, something went wrong.