6

Guys I really hate my life. It took me over 10 hours to find the solution to this problem. I compiled the contract with various different methods. Deployment worked with each of the but the contract couldn't be verified nontheless. After a while I figured out that I didn't set the optimisation checkbox on etherscan to "yes". I was compiling optimized all ...


3

There's no way for you to get them back, tokens sent to that particular contract that you're referring to, are stuck there forever. The contract that you link to has no way to withdraw tokens mistakenly sent to it. Perhaps your best chance is to reach out to the MWAT team and explain your situation, perhaps they can try to resolve it in someway.


2

For 1 you may use web3.eth.getCode(address) function of Web3 API. For contract addresses it returns contract byte code, while for non-contract addresses it returns something like "0x". For 3 it depends on what "public" means for you. If you mean whether smart contract has verified source code published at Etherscan.io, then you may use either API call to ...


2

It is unclear what layer you want to find out this information on (on-chain or off-chain). In general: Is an address a smart contract? This can be checked by seeing if there is associated code at the address. Is this smart contract ERC20 or ERC721 token? Off-chain, you can check this by observing the contract on Etherscan. There are also interfaces ...


1

You can simply check val as a uint. Your code would look as follows: function airdrop(uint val) public payable { require(airdrop == true); if (val == 1){ msg.sender.transfer(1 ether); airdrop = false; } }


1

I think this will work: result.events.numberSaved.returnValues['number']


Only top voted, non community-wiki answers of a minimum length are eligible