Polygon support for ERC777 - solidity

Does Polygon network support ERC777 token? I am writing a cryptocurrency with the intention of deploying it to Polygon.
Between ERC20 and ERC777, I am thinking of using ERC777 given that it is the upgraded version.
I see from https://faucet.polygon.technology that the test tokens I can receive are only ERC20, ERC721 and ERC1155.
Is ERC777 supported? Or should I remain on ERC20, or use ERC1155?

Yes, it does support it. I just tested it and everything works, including the operatorSend function (which is the main reason to go for 777 instead of 20).
Here's one that is deployed and running fine: https://polygonscan.com/address/0x6f80d1a3ab9006548c2fbb180879b87364d63bf7#code

Related

How do I make free read-only calls to a smart contract on Hedera blockchain network without incurring charges?

The problem is that I am trying to make free read-only calls to a smart contract on the Hedera network, but am encountering unexpected results. I have tried various methods, but am unable to successfully make the calls without incurring charges. I am looking for a solution or guidance on how to properly make these free read-only calls to the smart contract on Hedera.
//Create the transaction
const transaction = new ContractExecuteTransaction()
.setContractId(newContractId)
.setFunction("get_message")
I expected this get_message to not charge me HBAR since that function just returns a hardcoded string but I cant execute it for free like I want to. How do I do this?
If you're using the SDK, using ContractCallQuery() is better suited for read-only queries. See sample below:
// Query the contract to check changes in state variable
const contractQueryTx1 = new ContractCallQuery()
.setContractId(contractId)
.setGas(100000)
.setFunction("get_message";
const contractQuerySubmit1 = await contractQueryTx1.execute(client);
Note that the SDK still requires some small amount of gas.
There are a couple of other ways to do cost-free queries.
Use mirror nodes. These two tutorials can give you additional information on working with mirror nodes: https://hedera.com/blog/how-to-inspect-smart-contract-transactions-on-hedera-using-mirror-nodes and https://hedera.com/blog/how-to-look-up-transaction-history-on-hedera-using-mirror-nodes-back-to-the-basics
If you use Hashio (https://swirldslabs.com/hashio/) as a JSON-RPC relay, then you can use EVM tooling to deploy and interact with contracts on Hedera. Then you can simply call contracts the way you would in a chain like Ethereum. Here are some examples: https://github.com/hashgraph/hedera-json-rpc-relay/tree/main/tools

Mock a client to a dependency when doing integration tests

I have a service composed of several micro services working in workflow. Some of these MS are calling dependencies.
Now I'd like to mock these calls, so when I send a message at the entrance of the workflow the dependencies answers get mocked, but my system works as normal.
The challenge is that I would want to configure the mock from the outside: Configure on the fly the answer I want to get from the mock, run my test, verify that my system behaves properly.
I worked for a company that shall remain unnamed that has an internal tool doing just that, but I'm wondering if there is a public tool doing this? I can't believe it doesn't exist, I bet more on my lack of knowledge about this, at that point ;)
Cheers
So far best I've found is https://wiremock.org/docs/
I don't want to do any ad here, it's just the only one I see that gets its mocks configured from a distance

Why can I not deploy this BEP20 token with Remix?

I am trying to deploy this contract
https://github.com/juustesout/EtherRanger/blob/main/EtherRanger.sol
to BSC Testnet, and I get this error in return :
"revert
The transaction has been reverted to the initial state.
Note: The called function should be payable if you send value and the value you send should be less than your current balance.
Debug the transaction to get more information. "
this is an example of a failed transaction on BSC Testnet
https://testnet.bscscan.com/tx/0x5cbe0adcf6a522d89c974cadf70358dd9d79476988b4fb829fc1cc86c88aff0c
I tried forking multiple contracts from BSC, working tokens, but I always get the same error. I tried adding 'payable' to the constructor function, as other StackOverflow posts suggest, but no go. I have been reading any number of posts through Google Search, but I am getting nowhere.
The contracts compile flawless, no errors, no warnings, but they just won't deploy.
Could someone check if they can deploy this contract on BSC Testnet ? It may be a setting on my Remix or something, I am at a loss, I cannot tell where the error comes from.
I don’t know anything about this contract but I guess the hardcoded addresses for the IBEP20 and others are the problem. You need to deploy these contracts too and then pass their addresses to the interface addresses in your constructor.
But to connect to the BSC test network, you need to find the drop-down menu with a list of networks at the top of the MetaMask
https://domhtml.ru/en/sozdanie-sobstvennyh-tokenov-standarta-bep-20-v-seti-binance-smart-chain-bsc-pri-pomoshhi-remix-ide/

Contract not getting listen on opensea mainnet, however shows NFTs in metamask & works on testnet

Just as the title says, on opensea testnets mumbai and ropsten, it 'imports' the smart contract to create the collection, however on the polygon mainnet, the same contracts are working perfectly.
The NFTs even show in my wallet on the mainnet, the contract is verified on etherscan & I can mint.
Please check https://polygonscan.com/address/0xb6AF03FE32Ac3DffDd4F2661270DFEE00C15c3d9
Is there anything special I have to do for the mainnet opensea to accept my smart contract?
Thank you very much!!
I created a new smart contract and added
import "#openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
Now it seems to work, still, I fail to understand why on the testnet opensea, it worked without it...
Sometimes development makes no sense.

BEP-20 Contract no deploy public view functions

I am studying how to make BEP-20 tokens. For this I copied the following contract in remix to be able to study it:
Contract in BscScan
If I copy the whole file and compile it in Remix, when I deploy it it doesn't show me any getters. No public view function appears. If I look at the contract displayed on the testnet, it doesn't have any supply of tokens either.
I separated the files and libraries for a better reading. And it is then, when I try to display it, that I get the following error:
VM error: revert. revert The transaction has been reverted to the initial state. Note: The called function should be payable if you send value and the value you send should be less than your current balance. Debug the transaction to get more information.
It gives me the feeling that this contract does not generate the tokens ... What am I wrong?
I managed to fix the problem. As I suspected, in order to deploy the contract I have to remove everything related to uniswap and cakeswap. This displays the contract correctly.
If you wanted to deploy the contract with the uniswap interfaces in injected web3, you would need the uniswap testnet.
I found a test address for cake here:
Binance Smart change tesnet