Skip to main content
Bumped by Community user
added 82 characters in body
Source Link
Nat
  • 3.4k
  • 14
  • 23

Error 3100006: Subjective exception thrown during block production Error Details: Cannot charge RAM to other accounts during notify.

Error 3100006: Subjective exception thrown during block production
Error Details:
Cannot charge RAM to other accounts during notify.

#undef EOSIO_ABI #define EOSIO_ABI( TYPE, MEMBERS )
extern "C" {
void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
auto self = receiver;
if( action == N(onerror)) {
/* onerror is only valid if it is for the "eosio" code account and authorized by "eosio"'s "active permission /
eosio_assert(code == N(eosio), "onerror action's are only valid from the "eosio" system account");
}
print( "receiver, ", name{receiver} );
print( "code, ", name{code} );
print( "action, ", name{action} );
TYPE thiscontract( self );
if(code == N(eosio.token) && action == N(transfer) ) {
thiscontract.buy(unpack_action_dataeosio::currency::transfer());
switch( action ) {
break;
EOSIO_API( TYPE, MEMBERS )
}
/
does not allow destructor of thiscontract to run: eosio_exit(0); */
}
}
} \

#undef EOSIO_ABI
#define EOSIO_ABI( TYPE, MEMBERS ) 
extern "C" { 
void apply( uint64_t receiver, uint64_t code, uint64_t action ) { 
      auto self = receiver; 
      if( action == N(onerror)) { 
         /* onerror is only valid if it is for the "eosio" code account and authorized by "eosio"'s "active permission */ 
         eosio_assert(code == N(eosio), "onerror action's are only valid from the \"eosio\" system account"); 
      } 
    print( "receiver, ", name{receiver} );
    print( "code, ", name{code} );
    print( "action, ", name{action} );
    TYPE thiscontract( self ); 
      if(code == N(eosio.token) && action == N(transfer) ) { 
    thiscontract.buy(unpack_action_data<eosio::currency::transfer>());
         switch( action ) { 
                break;
            EOSIO_API( TYPE, MEMBERS ) 
         } 
         /* does not allow destructor of thiscontract to run: eosio_exit(0); */ 
      } 
   } 
} 

Error 3100006: Subjective exception thrown during block production Error Details: Cannot charge RAM to other accounts during notify.

#undef EOSIO_ABI #define EOSIO_ABI( TYPE, MEMBERS )
extern "C" {
void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
auto self = receiver;
if( action == N(onerror)) {
/* onerror is only valid if it is for the "eosio" code account and authorized by "eosio"'s "active permission /
eosio_assert(code == N(eosio), "onerror action's are only valid from the "eosio" system account");
}
print( "receiver, ", name{receiver} );
print( "code, ", name{code} );
print( "action, ", name{action} );
TYPE thiscontract( self );
if(code == N(eosio.token) && action == N(transfer) ) {
thiscontract.buy(unpack_action_dataeosio::currency::transfer());
switch( action ) {
break;
EOSIO_API( TYPE, MEMBERS )
}
/
does not allow destructor of thiscontract to run: eosio_exit(0); */
}
}
} \

Error 3100006: Subjective exception thrown during block production
Error Details:
Cannot charge RAM to other accounts during notify.
#undef EOSIO_ABI
#define EOSIO_ABI( TYPE, MEMBERS ) 
extern "C" { 
void apply( uint64_t receiver, uint64_t code, uint64_t action ) { 
      auto self = receiver; 
      if( action == N(onerror)) { 
         /* onerror is only valid if it is for the "eosio" code account and authorized by "eosio"'s "active permission */ 
         eosio_assert(code == N(eosio), "onerror action's are only valid from the \"eosio\" system account"); 
      } 
    print( "receiver, ", name{receiver} );
    print( "code, ", name{code} );
    print( "action, ", name{action} );
    TYPE thiscontract( self ); 
      if(code == N(eosio.token) && action == N(transfer) ) { 
    thiscontract.buy(unpack_action_data<eosio::currency::transfer>());
         switch( action ) { 
                break;
            EOSIO_API( TYPE, MEMBERS ) 
         } 
         /* does not allow destructor of thiscontract to run: eosio_exit(0); */ 
      } 
   } 
} 
Source Link
R B
  • 31
  • 2

how to solve Error Details: Cannot charge RAM to other accounts during notify on testnet

I need help for an issue developing an EOS dapp. I want to call a contract function when someone transfer EOS to my contract. For this i used the apply method to call the function upon any transfer to my contract. This contract works fine on Local chain but getting error on testnet.

Here is the error that we get :

Error 3100006: Subjective exception thrown during block production Error Details: Cannot charge RAM to other accounts during notify.

Below is the code of apply function:

#undef EOSIO_ABI #define EOSIO_ABI( TYPE, MEMBERS )
extern "C" {
void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
auto self = receiver;
if( action == N(onerror)) {
/* onerror is only valid if it is for the "eosio" code account and authorized by "eosio"'s "active permission /
eosio_assert(code == N(eosio), "onerror action's are only valid from the "eosio" system account");
}
print( "receiver, ", name{receiver} );
print( "code, ", name{code} );
print( "action, ", name{action} );
TYPE thiscontract( self );
if(code == N(eosio.token) && action == N(transfer) ) {
thiscontract.buy(unpack_action_dataeosio::currency::transfer());
switch( action ) {
break;
EOSIO_API( TYPE, MEMBERS )
}
/
does not allow destructor of thiscontract to run: eosio_exit(0); */
}
}
} \