mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-10-27 05:59:52 +00:00
Support solc v0.8.35 (#512)
- Support solc v0.8.35 - The new `erc7201` is comptime (already translated to a constant in Yul) Didn't spot any relevant breakage or addition in the release notes so should be no-brainer. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
1 parent
1308b446f1
commit
ee869cdd18
11 files changed
+68
-9
No files matched your search
@@ -19,7 +19,7 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p solc
|
mkdir -p solc
|
||||||
curl -sSL --output solc/solc https://github.com/argotorg/solidity/releases/download/v0.8.34/${SOLC_NAME}
|
curl -sSL --output solc/solc https://github.com/argotorg/solidity/releases/download/v0.8.35/${SOLC_NAME}
|
||||||
|
|
||||||
- name: Make Solc Executable
|
- name: Make Solc Executable
|
||||||
if: ${{ runner.os == 'Windows' }}
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
# The compiler modes to use for compilation by retester.
|
# The compiler modes to use for compilation by retester.
|
||||||
MODES: "Y M0 S+, Y M3 S+, Y Mz S+"
|
MODES: "Y M0 S+, Y M3 S+, Y Mz S+"
|
||||||
SOLC_VERSION: "0.8.34"
|
SOLC_VERSION: "0.8.35"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ jobs:
|
|||||||
- name: Basic Sanity Check
|
- name: Basic Sanity Check
|
||||||
run: |
|
run: |
|
||||||
mkdir -p solc
|
mkdir -p solc
|
||||||
curl -sSLo solc/soljson.js https://github.com/argotorg/solidity/releases/download/v0.8.34/soljson.js
|
curl -sSLo solc/soljson.js https://github.com/argotorg/solidity/releases/download/v0.8.35/soljson.js
|
||||||
node -e "
|
node -e "
|
||||||
// Make sure to require './solc/soljson' and not 'solc/soljson' in order to use
|
// Make sure to require './solc/soljson' and not 'solc/soljson' in order to use
|
||||||
// the explicitly downloaded solc, rather than resolving an npm package potentially
|
// the explicitly downloaded solc, rather than resolving an npm package potentially
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
- Updated `LLVM` from `21.1.8` to LLVM `22.1.4`
|
- Updated `LLVM` from `21.1.8` to LLVM `22.1.4`
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Support for solc v0.8.35.
|
||||||
|
|
||||||
## v1.1.0
|
## v1.1.0
|
||||||
|
|
||||||
Supported `polkadot-sdk` rev: `2603`
|
Supported `polkadot-sdk` rev: `2603`
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
pragma solidity ^0.8.35;
|
||||||
|
|
||||||
|
/* runner.json
|
||||||
|
{
|
||||||
|
"differential": true,
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"Instantiate": {
|
||||||
|
"code": {
|
||||||
|
"Solidity": {
|
||||||
|
"contract": "ERC7201"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// Tests the `erc7201` builtin introduced in solc 0.8.35.
|
||||||
|
/// Reference: https://eips.ethereum.org/EIPS/eip-7201
|
||||||
|
contract ERC7201 {
|
||||||
|
/// Reference implementation of the ERC-7201 base slot formula in pure
|
||||||
|
/// Solidity. Used to cross-check the builtin output.
|
||||||
|
function referenceSlot(string memory id) internal pure returns (uint256) {
|
||||||
|
return uint256(
|
||||||
|
keccak256(bytes.concat(bytes32(uint256(keccak256(bytes(id))) - 1)))
|
||||||
|
& ~bytes32(uint256(0xff))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor() payable {
|
||||||
|
// Compile-time path: literal argument, solc folds the result into a
|
||||||
|
// numeric constant in the emitted Yul.
|
||||||
|
assert(erc7201("example.main") == referenceSlot("example.main"));
|
||||||
|
assert(
|
||||||
|
erc7201("erc7201:openzeppelin.storage.Initializable")
|
||||||
|
== referenceSlot("erc7201:openzeppelin.storage.Initializable")
|
||||||
|
);
|
||||||
|
assert(erc7201("") == referenceSlot(""));
|
||||||
|
|
||||||
|
// Runtime path: non-literal argument, solc emits a Yul utility
|
||||||
|
// function that performs the keccak256 hashes at runtime.
|
||||||
|
string memory id = "example.main";
|
||||||
|
assert(erc7201(id) == referenceSlot(id));
|
||||||
|
|
||||||
|
string memory empty = "";
|
||||||
|
assert(erc7201(empty) == referenceSlot(empty));
|
||||||
|
|
||||||
|
// The two paths must agree.
|
||||||
|
assert(erc7201("example.main") == erc7201(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,6 +67,7 @@ test_spec!(add_mod_mul_mod, "AddModMulModTester", "AddModMulMod.sol");
|
|||||||
test_spec!(memory_bounds, "MemoryBounds", "MemoryBounds.sol");
|
test_spec!(memory_bounds, "MemoryBounds", "MemoryBounds.sol");
|
||||||
test_spec!(selfdestruct, "Selfdestruct", "Selfdestruct.sol");
|
test_spec!(selfdestruct, "Selfdestruct", "Selfdestruct.sol");
|
||||||
test_spec!(clz, "CountLeadingZeros", "CountLeadingZeros.sol");
|
test_spec!(clz, "CountLeadingZeros", "CountLeadingZeros.sol");
|
||||||
|
test_spec!(erc7201, "ERC7201", "ERC7201.sol");
|
||||||
test_spec!(call_gas, "CallGas", "CallGas.sol");
|
test_spec!(call_gas, "CallGas", "CallGas.sol");
|
||||||
test_spec!(linker_symbol, "Linked", "Linked.sol");
|
test_spec!(linker_symbol, "Linked", "Linked.sol");
|
||||||
test_spec!(
|
test_spec!(
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ pub mod version;
|
|||||||
pub const FIRST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 0);
|
pub const FIRST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 0);
|
||||||
|
|
||||||
/// The last supported version of `solc`.
|
/// The last supported version of `solc`.
|
||||||
pub const LAST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 34);
|
pub const LAST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 35);
|
||||||
|
|
||||||
/// The Solidity compiler.
|
/// The Solidity compiler.
|
||||||
pub trait Compiler {
|
pub trait Compiler {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const path = require("path");
|
|||||||
const { minify } = require("terser");
|
const { minify } = require("terser");
|
||||||
|
|
||||||
const SOLJSON_URI =
|
const SOLJSON_URI =
|
||||||
"https://binaries.soliditylang.org/wasm/soljson-v0.8.34+commit.80d5c536.js";
|
"https://binaries.soliditylang.org/wasm/soljson-v0.8.35+commit.47b9dedd.js";
|
||||||
const RESOLC_WASM_URI =
|
const RESOLC_WASM_URI =
|
||||||
process.env.RELEASE_RESOLC_WASM_URI || "http://127.0.0.1:8080/resolc.wasm";
|
process.env.RELEASE_RESOLC_WASM_URI || "http://127.0.0.1:8080/resolc.wasm";
|
||||||
const RESOLC_WASM_TARGET_DIR = path.join(
|
const RESOLC_WASM_TARGET_DIR = path.join(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "revive",
|
"name": "revive",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"solc": ">=0.8.0 <=0.8.34"
|
"solc": ">=0.8.0 <=0.8.35"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"example:web": "http-server ./examples/web/",
|
"example:web": "http-server ./examples/web/",
|
||||||
|
|||||||
@@ -34,6 +34,6 @@
|
|||||||
"commander": "^13.1.0",
|
"commander": "^13.1.0",
|
||||||
"package-json": "^10.0.1",
|
"package-json": "^10.0.1",
|
||||||
"resolve-pkg": "^2.0.0",
|
"resolve-pkg": "^2.0.0",
|
||||||
"solc": ">=0.8.0 <=0.8.34"
|
"solc": ">=0.8.0 <=0.8.35"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+2
-2
@@ -18,7 +18,7 @@
|
|||||||
"js/emscripten": {
|
"js/emscripten": {
|
||||||
"name": "revive",
|
"name": "revive",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"solc": ">=0.8.0 <=0.8.34"
|
"solc": ">=0.8.0 <=0.8.35"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@playwright/test": "^1.59.1",
|
"@playwright/test": "^1.59.1",
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
"commander": "^13.1.0",
|
"commander": "^13.1.0",
|
||||||
"package-json": "^10.0.1",
|
"package-json": "^10.0.1",
|
||||||
"resolve-pkg": "^2.0.0",
|
"resolve-pkg": "^2.0.0",
|
||||||
"solc": ">=0.8.0 <=0.8.34"
|
"solc": ">=0.8.0 <=0.8.35"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"resolc": "dist/bin.js"
|
"resolc": "dist/bin.js"
|
||||||
|
|||||||
Reference in new issue
Block a user