ERC721A staking contract that rewards in ERC20? - solidity

Having trouble finding 2 smart contracts (ERC721A staking contract that rewards in ERC20)
I am using the hashlips erc721a script for my NFT collection.
Can anyone point me in the right direction for these staking/rewards contracts?
Thank you!

Related

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/

How to deposit into an Ink! Smart Contract

I have a few ideas for smart contracts that I will be implementing using Ink! on Substrate.
Most of these ideas involve callers making deposits into the smart contract which will be held indefinitely, and then the caller may be able to withdraw at some future point, depending on other factors.
I have found an example that allows callers to withdraw from a smart contract:
https://github.com/paritytech/ink/blob/master/examples/contract-transfer/lib.rs
This hints at an approach to the caller making a deposit - the self.env().transferred_value() method suggests the caller can/has send/sent value.
I am struggling to find an example that deposits funds into a smart contract. Perhaps I am missing something fundamental here?
Ideally I want to avoid implementing a function that takes 2 addresses and transfers from one to the other (the contract already having & knowing its own address!), instead favouring the caller sending an amount, and it being deposited into the smart contract.
I think this may be possible with a smart contract method that takes no parameters but not certain and not at all clear on how the contract would then receive & hold the funds.
Looking for a concrete code example to show how this works in full, but also appreciate any comments to clarify or correct my (quite possibly incorrect) understanding.
Thanks in advance!
The method of your contract, that expects the payments should be marked with #[ink(message, payable)] for example like here. During the call of that method the user should specify that amount to send in the native currency(in the case of polkadot-js it is value field of payable method).
In the method, you can use let amount = Self::env().transferred_value(); to get a sent amount. If your transaction is not rejected your contract will hold amount tokens on its balance. It works the same way as in Solidity.
To get the current balance of the contract Self::env().balance(). To send a native currency Self::env().transfer(to, amount).
Maybe it will be useful to check that example.

How exactly do i faciliate a transaction of an established ERC20 token between two users?

pragma solidity ^0.8.0;
import 'Token.sol';
import 'Encap.sol';
contract HEX_Extension {
function transfer_addy(address _to, uint amount) external {{
IHEX(0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39).approve(_to,amount);
IHEX(0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39).transferFrom(msg.sender,_to,amount);
}}
}
I am writing a contract that extends the functionality of HEX, an ERC20 token. I cannot for the life of me figure out how to validate a transaction between two users. Can someone explain what's wrong with this code? I keep getting thrown the error that says the allowance is too low, even though i set the allowance in the transfer method.
I'm not sure if this makes a difference, but I am testing this contract in the Injected Web3 setting in Remix.
This line doesn't not allows the HEX to use your token on behalf of HEX_Extension as you might expected.
IHEX(0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39).approve(_to,amount);
You need to make an approval from your wallet to the IHEX, that allows he address of contract HEX_Extension use your own token.
Example: let's say you deployed the HEX_Extension into address 0xABCDE.... Then from your MM, make a call to approve function of HEX contract, approve(0xABCDE...., amount) before the transfer_addy.

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