CRYPTO NEWS

Solidity cast address to a different class

What’s the expected behavior if I cast an address A to a wrong class CA? For example, BAYC (https://etherscan.io/address/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d#code) is an IERC721Enumerable. What if I cast its address to a ERC721EnumerableUpgradeable? Then I guess certainly calling upgradeProxy() on BAYC will return an error, but what if I call tokenOfOwnerByIndex()?

Geth javascript console how to subscribe using JSON RPC

I am running an go-ethereum client in light mode. I have connected to my node with ./geth attach /home/user/.ethereum/geth.ipc and have my geth console. I want to use real-time subscriptions mentioned here: Real-time Events | Go Ethereum. But when I enter {"id": 1, "method": "eth_subscribe", "params": ["newHeads"]} in my geth console for example, I get::Listen

I am running an go-ethereum client in light mode. I have connected to my node with ./geth attach /home/user/.ethereum/geth.ipc and have my geth console.

I want to use real-time subscriptions mentioned here: Real-time Events | Go Ethereum.

But when I enter {"id": 1, "method": "eth_subscribe", "params": ["newHeads"]} in my geth console for example, I get this error:

> {"id": 1, "method": "eth_subscribe", "params": ["newHeads"]} SyntaxError: SyntaxError: (anonymous): Line 1:6 Unexpected token : (and 2 more errors) 

How can I subscribe to real-time events on my geth console?

Solidity cast address to a different class

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