Skip to content

Conversation

@LucasGrasso
Copy link
Contributor

@LucasGrasso LucasGrasso commented Nov 9, 2025

Summary

Partially addresses #2653

  • [n] y/n | Does it introduce breaking changes?
  • [n] y/n | Is it dependent on a specific version of cargo-contract or pallet-revive?

Description

Implements the following host fns:

  • fn chain_id(output: &mut [u8; 32]);
  • fn balance_of(addr: &[u8; 20], output: &mut [u8; 32]);
  • fn base_fee(output: &mut [u8; 32]);
  • fn origin(output: &mut [u8; 20]);
  • fn code_size(addr: &[u8; 20]) -> u64;
  • fn block_hash(block_number: &[u8; 32], output: &mut [u8; 32]);
  • fn block_author(output: &mut [u8; 20]);

@LucasGrasso LucasGrasso changed the title Implement getters akin to EVM opcodes and block_author hostfns Implement getters akin to EVM opcodes Nov 9, 2025
@LucasGrasso LucasGrasso marked this pull request as ready for review November 9, 2025 23:52
@LucasGrasso
Copy link
Contributor Author

One question related to #2597. Should balance_of return Balance or U256? I've left it as U256 following the implementation of value_transferred().

@cmichi
Copy link
Collaborator

cmichi commented Nov 10, 2025

One question related to #2597. Should balance_of return Balance or U256? I've left it as U256 following the implementation of value_transferred().

Good that you ask, U256 is fine!

There are some CI failures, can you fix those? Merging master should also help with the CI.

@cmichi
Copy link
Collaborator

cmichi commented Nov 11, 2025

@LucasGrasso As an FYI, I've changed the ink GHA setting for running the CI from

Require approval for all external contributors

to

Require approval for first-time contributors

So you no longer need someone to approve your runs.

@LucasGrasso
Copy link
Contributor Author

So you no longer need someone to approve your runs.

Excellent, That was a bugger.
I think I fixed the error now, my bad it took to long to realize that the issue was actually in the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants