Skip to content

Commit

Permalink
refactor: forbid call eth_getStorageAt to system contract accounts (#…
Browse files Browse the repository at this point in the history
…1619)

refactor: forbid get storage of system contract account
  • Loading branch information
Eason Gao authored Dec 4, 2023
1 parent d9e7a17 commit 5d59656
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/api/src/jsonrpc/impl/web3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,10 @@ impl<Adapter: APIAdapter + 'static> Web3RpcServer for Web3RpcImpl<Adapter> {
position: U256,
block_id: Option<BlockId>,
) -> RpcResult<Hex> {
if is_system_contract_address_format(&address) {
return Err(RpcError::CallSystemContract.into());
}

let number = self.get_block_number_by_id(block_id).await?;

let header = self
Expand Down

0 comments on commit 5d59656

Please sign in to comment.