A tool to help with estimating NEAR gas spent by transactions on Aurora.

Overview

Aurora Gas Estimator

A tool to help with estimating NEAR gas spent by transactions on Aurora.

Building from source

Prerequisites

  • Rust
  • GNU Make (3.81+)
  • Node.js (v14+)

Steps

git clone --recurse-submodules https://github.com/birchmd/aurora-gas-estimator.git
cd aurora-gas-estimator/aurora-engine/
make release
cd ..
cargo build --release

The produced binary to use in future calls will be located at target/release/aurora-gas-estimator.

Usage

aurora-gas-estimator executes scripts that define a sequence of EVM interactions (creating accounts, deploying contracts, calling contracts). Some examples are found in the examples/ directory of this repo. A more complete description of the scripting "language" (its really just JSON) is available at docs/scripts.md.

To see the amount of NEAR gas a transaction is estimated to use, use the Print statement on a contract deployment or call in a script. This will add a JSON object in the output of the estimator which includes a near_gas_used field. The gas values are reported in raw gas units, however NEAR gas values are often presented in Tgas. Simply divide the return value by 10^12 to convert it into Tgas. For example:

aurora-gas-estimator -s examples/simple_contract_call.script | jq '.output[0].DeployedContract.deployment_near_gas_used'
aurora-gas-estimator -s examples/simple_contract_call.script | jq '.output[1].ContractCallResult.near_gas_used'

The amount of EVM gas burned is also available in the result object under the gas_used field.

aurora-gas-estimator -s examples/simple_contract_call.script | jq '.output[0].DeployedContract.deployment_result.gas_used'
aurora-gas-estimator -s examples/simple_contract_call.script | jq '.output[1].ContractCallResult.result.gas_used'
You might also like...
USN - the first NEAR-native stablecoin

USN USN is a NEAR-native USD stable coin. The contract implements fungible token API according to the following standards: NEP-141 (ERC-20 fashioned)

Durudex Near Protocol Token.

Durudex Near Token 💡 Prerequisites Rust Near CLI ⚙️ Build To build a token you will need to use this: cargo build --all --target wasm32-unknown-unkno

Helpful functions and macros for developing smart contracts on NEAR Protocol.

near-contract-tools Helpful functions and macros for developing smart contracts on NEAR Protocol. This package is a collection of common tools and pat

Helpful functions and macros for developing smart contracts on NEAR Protocol.

near-contract-tools Helpful functions and macros for developing smart contracts on NEAR Protocol. This package is a collection of common tools and pat

Confidential credit scores and loan disbursal, powered by zkSNARKs and NEAR Protocol
Confidential credit scores and loan disbursal, powered by zkSNARKs and NEAR Protocol

zkLoans zkLoans brings confidential Credit Scores. It proves to a counterparty if you meet threshold requirements for a credit score without revealing

evm2near compiles Solidity contracts into NEAR WebAssembly contracts.

EVM → NEAR evm2near is a project for compiling EVM bytecode into wasm bytecode, with the particular goal of having that wasm artifact be executable on

Lesson 1 - Fundamental structure of smartcontract of near protocol

NEAR CONTRACT dev-1672293046853-49717456344735 pnpm run deploy [email protected] deploy /Users/vudangquang/Courses/VBI-Courses/rs-contract cd co

A Software Development Kit (SDK) for Zero-Knowledge Transactions

Aleo SDK The Aleo SDK is a developer framework to make it simple to create a new account, craft a transaction, and broadcast it to the network. Table

Scans the Ethereum network for USDT ERC-20 token transfer transactions

ethscan This is a Rust command line program for scanning the Ethereum blockchain for USDT transfers within a time span and amount span. prerequisites

Releases(v0.3.0)
Owner
Michael Birch
I am a software developer in the Blockchain space. My favourite programming languages are Rust and Scala. I like doing math for fun.
Michael Birch
AMCOS - A high-peformance parallel monte-carlo simulation for estimating the fair value of options in finance

antoons-monte-carlo-options-sim A high-peformance parallel monte-carlo simulation for estimating the fair value of options in finance. Written in Rust

null 4 Jun 18, 2022
An automated CLI tool that optimizes gas usage in Solidity smart contracts, focusing on storage and function call efficiency.

Solidity-Gas-Optimizoor An high performance automated CLI tool that optimizes gas usage in Solidity smart contracts, focusing on storage and function

Chia Yong Kang 10 Mar 11, 2024
Vanitygen-bip39 - Generate vanity / gas efficient Ethereum addresses for your hdwallet (bip39 12 or 24 words)

vanitygen-bip39 Generate Ethereum gas efficient addresses with leading zeros https://medium.com/coinmonks/on-efficient-ethereum-addresses-3fef0596e263

iam4x 9 Jul 2, 2022
A Solidity static analyzer to identify contract vulnerabilities and gas efficiencies.

solstat A Solidity static analyzer to identify contract vulnerabilities and gas efficiencies. .------. .------. .------. .------. .------. .------. .-

null 345 Feb 18, 2023
Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Ahmad Abdullahi Adamu 7 Jan 9, 2023
Reference client for NEAR Protocol

Reference implementation of NEAR Protocol About NEAR NEAR's purpose is to enable community-driven innovation to benefit people around the world. To ac

NEAR 2k Jan 3, 2023
A PoC backbone for NFT Marketplaces on NEAR Protocol

NFT Market Reference Implementation A PoC backbone for NFT Marketplaces on NEAR Protocol. Reference Changelog Changelog Progress: basic purchase of NF

null 9 May 26, 2022
Reference client for NEAR Protocol

Reference implementation of NEAR Protocol About NEAR NEAR's purpose is to enable community-driven innovation to benefit people around the world. To ac

NEAR 2k Jan 4, 2023
Near contract collection for story-arc.io

arc-near-contracts TBD Development Setup Make sure to format code using defaults before every commit or set up the environment to handle this for you.

null 2 Mar 14, 2022
A tutorial for an NFT Market Place Built with Near Protocol and React.js

nft-marketplace-part-1 A tutorial for an NFT Market Place built using Near Protocol and React.js. Preview To run this app locally, follow below steps:

Kohwo Orien 5 Jun 29, 2022