-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathlib.cairo
More file actions
38 lines (33 loc) · 1.01 KB
/
lib.cairo
File metadata and controls
38 lines (33 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#[starknet::contract]
mod example {
use hdp_cairo::{
HDP, evm::block_receipt::{BlockReceiptTrait, BlockReceiptKey, BlockReceiptImpl},
evm::block_tx::{BlockTxTrait, BlockTxKey, BlockTxImpl},
};
use hdp_cairo::debug::print;
#[storage]
struct Storage {}
#[external(v0)]
pub fn main(ref self: ContractState, hdp: HDP) {
assert!(
hdp
.evm
.block_receipt_get_cumulative_gas_used(
BlockReceiptKey {
chain_id: 11155111, block_number: 5382809, transaction_index: 217,
},
) == u256 { low: 0x1a4bd13, high: 0x0 },
);
print(1);
assert!(
hdp
.evm
.block_tx_get_nonce(
BlockTxKey {
chain_id: 11155111, block_number: 5382809, transaction_index: 217,
},
) == u256 { low: 0x3, high: 0x0 },
);
print(2);
}
}