AnswerBun.com

I have doubts about intercontract communication

EOS.IO Asked by coder on January 5, 2022

I have read that:

In order to call an inline action, that is to call an action of contract A from contract B, there is a need to set some special permission. In this case, the Ram payer for the action in contract B must-have “accountname [email protected]” permission in its active. In a case, if account C needs to call an action in account A through a contract in account B, then account C need to set the [email protected] in its active.

But I observed that:

  1. Contract B must-have “accountname [email protected]” permission in its active even to call function from contract A & not “accountname [email protected]” permission in its active.
  2. If account C needs to call an action in account A through a contract in account B, then account C need to set the
    [email protected] in its active. This is true but is there any
    alternative that C can use contract B to call action from contract A
    without changing its permissions. Because in dapp it is not feasible
    for every user to do that.

I’m confused a bit about the all this. Can anyone please give me a clear guidance? Also, in accordance with the v2.0Latest version

One Answer

If a contract has an inline action, the permission for running that action must be eosio.code from that contract account. Thats it.

Example: accounta is a smart contract with an inline action to accountb. Therefore accounta will need the permission [email protected], as the contract will need to execute the inline action.

Answered by Phillip Hamnett - EOS42 on January 5, 2022

Add your own answers!

Related Questions

nodeos lib doesn’t found

2  Asked on August 20, 2021 by jimmy-guo

     

How to reduce NET and CPU usage in Private EOS

2  Asked on August 20, 2021 by zohaib-basit

       

use inline action with eosio.token

2  Asked on August 20, 2021 by ahmadkajjan

   

Declare custom structs

1  Asked on August 20, 2021 by jimmy-sullivan

 

chainbase::database error

1  Asked on August 20, 2021 by iambaeba1

   

Creating new account in EOS Studio throws signatures error

1  Asked on August 20, 2021 by milos-krstic

   

How to run nodeos consistently even when dirty flag is set?

1  Asked on August 20, 2021 by tigran-sahakyan

   

read datastream of length 29 over by -4

1  Asked on February 16, 2021 by lijianwei

 

Smart contract error while calling recover_key

1  Asked on February 6, 2021 by riccardo-persiani

     

Main steps for preparing IDE for Nodeos development

1  Asked on January 29, 2021 by congnghebitcoin-com

   

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP