I am developing a smart contract on solidity where user can deposit $CAKE in my pool and after depositing, the deposited $CAKE will be automatically redirected to some other pool. But I don't know how to write this! Can anyone help?
I don't have any clue on how to do this or even if it is possible?
How can I get OpenSea to lazy mint with a custom contract I built?
In other words, how do I get OpenSea to communicate with my custom contract during the sale of a lazy minted token?
I don’t want the lazy minted token to show up on the OpenSea smart contract. I want it to live on my custom contract after purchase.
So I have a token that has about 103 users. What I need to do is restrict the ability to sell those tokens to just myself the developer, so the other users can redeem their tokens for ETH or MATIC by sending to me. The alternative would be to just write a new smart contract, including this function and moving all users to the new platform. How would I write that new contract?
The first, you can't change code of deployed contract in Ethereum.
The second, look at ERC-20 and ERC-721 (NFT) standarts, its already have functionality you need.
I am deployed ERC-721 smart contract and sale was started and 3ETH in my contract
Now I am worried about how can I withdraw ETH from the contract to my wallet. How can I upgrade my contract with the withdrawal function?
Please help
Thanking in anticipation
If the contract is already deployed with no withdraw function, no proxie, without a delegatecall, is very hard or imposible to withdraw the ether
I was wondering if there's a PancakeSwap API, that allows me to swap BNB for a token, and if it isn't possible, can I do it with Binance Smart Chain's API?
Thank you!
pancakeswap currently doesn't have APIs or sdk as Uniswap sdk. Best solution is connect to binance smart chain and connect to the pancakeswap router contract through web3.
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
)
This is the function for swap tokens. You can refer the uniswap doc to get more information.
There's an API which allows you to find the best DEX on different blockchains, including BSC, and allows you to specify the DEX you want by excluding all of the other ones.
Here's a link to the API specification: https://0x.org/docs/api
An example you could type into the browser is:
https://bsc.api.0x.org/swap/v1/quote?buyToken=BUSD&sellToken=BNB&sellAmount=1000000000000000000&excludedSources=BakerySwap,Belt,DODO,DODO_V2,Ellipsis,Mooniswap,MultiHop,Nerve,SushiSwap,Smoothy,ApeSwap,CafeSwap,CheeseSwap,JulSwap,LiquidityProvider
This URL converts 1 BNB into BUSD on only Pancakeswap V1 and Pancakeswap V2.
You can also integrate this into a smart contract.
Hope this helps :D