builtins2.sol 546 B

12345678910111213141516171819202122
  1. contract builtins2 {
  2. function hash_blake2_128(bytes memory bs) public pure returns (bytes16) {
  3. return blake2_128(bs);
  4. }
  5. function hash_blake2_256(bytes memory bs) public pure returns (bytes32) {
  6. return blake2_256(bs);
  7. }
  8. function block_height() public view returns (uint64) {
  9. return block.number;
  10. }
  11. function burn_gas(uint64 x) public view returns (uint64) {
  12. // just burn some gas
  13. for (uint64 i = 0; i < x; i++) {
  14. uint64 no = block.number;
  15. }
  16. return gasleft();
  17. }
  18. }