CRYPTO NEWS

Stablecoins highlight 'structural fragilities' of crypto — Federal Reserve

“Stablecoins that are not backed by safe and sufficiently liquid assets and are not subject to appropriate regulatory standards create risks to investors,” said the Fed report.

How to interpret return after calling a function which returns bool in smart contract solidity

I have a newbie question about return of function call. The call was made with ethersjs 5.6.x and function is in solidity smart contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; contract MyCon { constructor(); function myfunc external returns (bool) { require(cond1, "condition1 not met"); //do something emit _success(); return true; } }::Listen

I have a newbie question about return of function call. The call was made with ethersjs 5.6.x and function is in solidity smart contract:

// SPDX-License-Identifier: MIT  pragma solidity ^0.8.0; pragma experimental ABIEncoderV2;   contract MyCon {   constructor();    function myfunc external returns (bool) {     require(cond1, "condition1 not met");     //do something      emit _success();     return true;    } } 

Here in front end, the function myfunc was called:

let _res = await _instance_of_MyCon.myfunc(); //called with ethersjs 5.6.x console.log(_res); 

In console output, instead of true or throwing error, the output is similar to something as below:

{"chainId": 2020, "confirmations": 0, "data": "0xc73cd2320000000000000000000000000000000000000000000000000000000000000001", "from": "0x2C5329a8fFe650839eafF91e40473063e0", "gasLimit": {"hex": "0xdef1", "type": "BigNumber"}, "gasPrice": {"hex": "0x00", "type": "BigNumber"}, "hash": "0xcb39ea0e41a6d2f0426b4c688af6c9dbef9096c57f54769a91e616ccf9ab3", "nonce": 191, "r": "0xa34ffdffc0fac3694e7ecc43425dd376becb298f205fdc684bfcc7cf3759", "s": "0x164563571044746c3a5f50ca3b863618f3ec4b997580d7e4515e0246a540", "to": "0x9DB9a455fb3cE67604bEfb4db483102fE3D", "type": null, "v": 4071, "value": {"hex": "0x00", "type": "BigNumber"}, "wait": [Function anonymous]} 

The event is not fired and neither is the error. How to tell if the function call is successful or not by output above? There is no revert. Assuming the function call went through fine, shall the app receive Boolean true in _res?

Stablecoins highlight 'structural fragilities' of crypto — Federal Reserve

Shopping cart
There are no products in the cart!
Continue shopping
0