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

Can smart contract account have resource of bandwidth? #6061

Open
GrothenDI opened this issue Oct 30, 2024 · 3 comments
Open

Can smart contract account have resource of bandwidth? #6061

GrothenDI opened this issue Oct 30, 2024 · 3 comments

Comments

@GrothenDI
Copy link

I know It can have resource of energy. About bandwidth, I am a little puzzled.

@endiaoekoe
Copy link

endiaoekoe commented Oct 30, 2024

@GrothenDI
per my understanding, a smart contract account can have both energy resources as well as bandwidth resource.
a smart contract account can stake TRX to acquire resources(energy or bandwidth)

use 'wallet/getaccountresource' endpoint to query the resouces(energy/bandwidth) a sc account have;

for the specific mechanism of how TRX resource model work,check it here ;

@DongDongSunny
Copy link

DongDongSunny commented Nov 1, 2024

tron account generated by wallet and smart contract account are both account in Tron with same resource model like free bandwidth, energy.

@DongDongSunny
Copy link

DongDongSunny commented Nov 1, 2024

The special part would be the way to get (extra bandwith) and energy, as current we cannot directly call Tron API to do smart contract account resource gain through freezeBalanceV2 or delegateResource, but we can write smart contract logic to allow contract account itself to freezeBalanceV2. Delegate resource to smart contract address is not allowed in Tron.

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

No branches or pull requests

3 participants