2
Yes.
You can use the getCode API. If that call returns 0x, there is no contract at that address. If it returns anything other than 0x, there is a contract at that address.
As an example:
web3.eth.getCode("0xd5677cf67b5aa051bb40496e68ad359eb97cfbf8")
.then(console.log);
> "...
1
Turns out I can only get the transaction hash for the _mint call, but I was able to recover the data (currentTokenId) by checking the transaction event by it's hash.
I'm not sure it's the best solution but here is how I've done it :
this.mint = function(callback) {
var mintTxHash = null
this.contract.methods.mint().send({from: this.account}, function(...
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
web3js × 4228solidity × 1088
go-ethereum × 672
metamask × 396
truffle × 395
javascript × 322
nodejs × 301
contract-development × 284
transactions × 270
events × 214
blockchain × 191
dapps × 174
ethereumjs × 169
contract-deployment × 168
infura × 153
contract-invocation × 150
dapp-development × 145
erc-20 × 127
web3-providers × 119
react × 114
remix × 111
ether × 102
ganache × 100
tokens × 90
testrpc × 90