Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does TronBox support forked networks like Hardhat? #270

Open
cfengliu opened this issue Dec 24, 2024 · 7 comments
Open

Does TronBox support forked networks like Hardhat? #270

cfengliu opened this issue Dec 24, 2024 · 7 comments

Comments

@cfengliu
Copy link

cfengliu commented Dec 24, 2024

Hi
Does Tronbox support network forking functionality similar to Hardhat's forking feature for local development and testing?

module.exports = {
  networks: {
    mainnet_fork: {
      url: "https://api.trongrid.io/",
      fork: {
        url: "https://api.trongrid.io/",
        blockNumber: 12345678
      }
    }
  }
}

If not, how do you test the contract before deploying it?

@llwslc
Copy link
Contributor

llwslc commented Dec 24, 2024

@cfengliu

Does not support forked networks, has local development environment and test network.

local development https://registry.hub.docker.com/r/tronbox/tre
testnet https://nileex.io/join/getJoinPage

@cfengliu
Copy link
Author

@cfengliu

Does not support forked networks, has local development environment and test network.

local development https://registry.hub.docker.com/r/tronbox/tre testnet https://nileex.io/join/getJoinPage

ok. Are there any addresses for smart routers on the testnet?

@llwslc
Copy link
Contributor

llwslc commented Dec 24, 2024

@cfengliu What are smart routers?

@cfengliu
Copy link
Author

cfengliu commented Dec 26, 2024

@cfengliu What are smart routers?

@llwslc
hi, I mean this contract. https://tronscan.org/#/contract/TJ4NNy8xZEqsowCBhLvZ45LCqPdGjkET5j

Do you know why using a contract to interact with the smart router is so expensive? When I interact directly with the smart router, the energy consumption is between 1 and 2 units. However, if I interacted it with my own contract, it consumes approximately 40 units of energy.

Thanks!

@llwslc
Copy link
Contributor

llwslc commented Dec 26, 2024

@cfengliu The energy consumption ratio of this contract is 99%, so a direct call only costs 1% of the energy.
https://developers.tron.network/v3.7/docs/energy-consumption

@cfengliu
Copy link
Author

cfengliu commented Dec 26, 2024

@llwslc got it. thanks. that is the point.
So only EOA wallets can get 1% energy consumption when making a direct call as contract callers? The contract account as a contract caller makes an internal call to Smart Router still need to pay 100%?

@llwslc
Copy link
Contributor

llwslc commented Dec 27, 2024

@cfengliu Yes, it works for EOA.

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

No branches or pull requests

2 participants