mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 21:01:01 +00:00
Generated
+370
-370
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -68,7 +68,7 @@ git2 = "0.19.0"
|
|||||||
# polkadot-sdk and friends
|
# polkadot-sdk and friends
|
||||||
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
|
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
|
||||||
scale-info = { version = "2.11.1", default-features = false }
|
scale-info = { version = "2.11.1", default-features = false }
|
||||||
polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk", rev = "2cbb4377d36af0aec9ae29dcabc5f5b1e88ed1db" }
|
polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk", rev = "243b751abbb94369bbd92c83d8ab159ddfc3c556" }
|
||||||
|
|
||||||
# llvm
|
# llvm
|
||||||
[workspace.dependencies.inkwell]
|
[workspace.dependencies.inkwell]
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
pragma solidity ^0.8;
|
||||||
|
|
||||||
|
/* runner.json
|
||||||
|
{
|
||||||
|
"differential": false,
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"Instantiate": {
|
||||||
|
"code": {
|
||||||
|
"Solidity": {
|
||||||
|
"contract": "BaseFee"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"VerifyCall": {
|
||||||
|
"success": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
contract BaseFee {
|
||||||
|
constructor() payable {
|
||||||
|
assert(block.basefee == 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -49,6 +49,7 @@ test_spec!(delegate, "Delegate", "Delegate.sol");
|
|||||||
test_spec!(gas_price, "GasPrice", "GasPrice.sol");
|
test_spec!(gas_price, "GasPrice", "GasPrice.sol");
|
||||||
test_spec!(gas_left, "GasLeft", "GasLeft.sol");
|
test_spec!(gas_left, "GasLeft", "GasLeft.sol");
|
||||||
test_spec!(gas_limit, "GasLimit", "GasLimit.sol");
|
test_spec!(gas_limit, "GasLimit", "GasLimit.sol");
|
||||||
|
test_spec!(base_fee, "BaseFee", "BaseFee.sol");
|
||||||
|
|
||||||
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {
|
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {
|
||||||
vec![Instantiate {
|
vec![Instantiate {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ pub fn basefee<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
Ok(context.word_const(0).as_basic_value_enum())
|
context.build_runtime_call_to_getter(revive_runtime_api::polkavm_imports::BASE_FEE)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Translates the `address` instruction.
|
/// Translates the `address` instruction.
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ POLKAVM_IMPORT(void, balance, uint32_t)
|
|||||||
|
|
||||||
POLKAVM_IMPORT(void, balance_of, uint32_t, uint32_t)
|
POLKAVM_IMPORT(void, balance_of, uint32_t, uint32_t)
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, base_fee, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(void, block_hash, uint32_t, uint32_t)
|
POLKAVM_IMPORT(void, block_hash, uint32_t, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(void, block_number, uint32_t)
|
POLKAVM_IMPORT(void, block_number, uint32_t)
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ pub static BALANCE: &str = "balance";
|
|||||||
|
|
||||||
pub static BALANCE_OF: &str = "balance_of";
|
pub static BALANCE_OF: &str = "balance_of";
|
||||||
|
|
||||||
|
pub static BASE_FEE: &str = "base_fee";
|
||||||
|
|
||||||
pub static BLOCK_HASH: &str = "block_hash";
|
pub static BLOCK_HASH: &str = "block_hash";
|
||||||
|
|
||||||
pub static BLOCK_NUMBER: &str = "block_number";
|
pub static BLOCK_NUMBER: &str = "block_number";
|
||||||
@@ -78,12 +80,13 @@ pub static WEIGHT_TO_FEE: &str = "weight_to_fee";
|
|||||||
|
|
||||||
/// All imported runtime API symbols.
|
/// All imported runtime API symbols.
|
||||||
/// Useful for configuring common attributes and linkage.
|
/// Useful for configuring common attributes and linkage.
|
||||||
pub static IMPORTS: [&str; 33] = [
|
pub static IMPORTS: [&str; 34] = [
|
||||||
SBRK,
|
SBRK,
|
||||||
MEMORY_SIZE,
|
MEMORY_SIZE,
|
||||||
ADDRESS,
|
ADDRESS,
|
||||||
BALANCE,
|
BALANCE,
|
||||||
BALANCE_OF,
|
BALANCE_OF,
|
||||||
|
BASE_FEE,
|
||||||
BLOCK_HASH,
|
BLOCK_HASH,
|
||||||
BLOCK_NUMBER,
|
BLOCK_NUMBER,
|
||||||
CALL,
|
CALL,
|
||||||
|
|||||||
Reference in New Issue
Block a user