How can I add a burn function to a BSC smart contract? - smartcontracts

University is out for summer and I am attempting to develop a smart contract on binance smart chain.
I have followed a youtube tutorial and made a very basic token which allows buys and sells, however I would like to add a burn function i.e a tax is placed on every transaction, and I would like x% to be added to liquidity on pancakeswap, x% to be burned and x% to be redistributed to holders of my token.
The internet seems to be pretty scarce on information on how to implement this, so if anyone would mind giving me a hand it would be great!
I am creating the token on remix.ethereum.org

Related

Automate sending info to the blockchain once an specific number of entries is reached?

It's a music website, the idea is to record on the blockchain every time a song is played.
Since we don't want to force users to install metamask so they can sign transactions, the idea is to store in an array, so that the smart contract sends it to the blockchain every 100 plays for example.
What's the best way to achieve this?
Please explain better, what technology do you use for your website? .net asp?
when you say "send to the blockchain" do you mean to a smart contract?
and an array of what do you want to send?
If you want to send something from a website to a smart contract on the blockchain you can use Nethereum thru .net asp.
Shouldn't be hard to write a c# code to send something every X times.
Just remember that storing new data on the blockchain cost gas (money).

Link NFT Collection to Opensea

Hi super basic question as I am new to NFT dev (currently learning solidity). Looking to make a super basic NFT project with website, art, and link to Opensea in secondary market (no roadmap, just a learning experience for me and probably giving NFTs for free). I understand that you can make a candy machine that allows users to mint on website, but I'd like them to be able to view and trade their nfts on a secondary marketplace like Opensea. How would I go about doing this? Thanks.
After minting nfts, they can be view and trade on Opensea and do not need additional actions.
As stated before, you don't need to do anything to actually have them in Opensea, except to deploy your SC.
I think this could be very useful to you https://buildspace.so/p/mint-nft-collection if you are just beginning and new. It's a well explained tutorial, and you can see there how this would work for you to see it in opensea.
Hope that helps.

What happens when you 'create' an item on the OpenSea app?

Very noobie here. I'm sorry,
Does anybody know what happens on OpenSea when you actually CREATE an item?
I know it doesn't mint one but what it does? (As it signs a transaction tho).
I've been trying for weeks to understand the "gasless" proxy thing they have but I don't know how they actually transfer an NFT to your Wallet, even if it's not minted.
I also managed to deploy and mint a Creature with the example contract (open sea creatures, https://github.com/ProjectOpenSea/opensea-creatures) but how can I let Users mint their own item on this factory contract?

Good Practices for Auction E-Commerce - Should I store Credit Cards Details?

I am sorry if this wasn't a good place to ask a question like this, but since I always got help from Stackoverflow I though I could get some answer to my problem.
So here is the thing, I am building a e-commerce website like many famous websites over there, where you can make bid offers for items on the market.
The thing I want to be sure is that when someone place a bid for some item, they can not turn back on their word, because if they get accepted the money should be withdrawn from their bank accounts, do you get what I mean?
Because I want the merchant to be safe if they accept a offer they want the money, and they don't want to look for another legit offer.
So how can I accomplish this?
Should I ask the credit card details when they make the bid offer and only make the withdraw operation from their accounts if the their offer was accepted by the merchant? [using some automated trigger on my database of course]
If this is not the best practice to accomplish this, which is the one??
I am really new into payment methods and I just started doing my search for Payment Gateways (maybe they offer me this functionality... I don't know?!)
You should never store credit card details, and have the details is not really any guarantee of getting paid since the card could just be canceled.
What you are probably looking for is for Authorization and delayed capture (depending on the timeline you are looking at). Different payment processors have different time requirements around how long you can hold an authorization. In general you would make a request with the API to Authorize the charges (kind of like a 'hold' on your credit card) and then later you would either cancel or Capture, where the funds would be transferred. See more info about the process and Square's API here: https://docs.connect.squareup.com/articles/delayed-capture-transactions/

Personal Money Movement API

I'm trying to create a simple personal project: I want to give myself bounties for completing tasks that often fester on my todo list. If I complete a task, for example, $5 should automatically move out of my savings account into a discretionary spending debit card.
Are there any APIs or banks that have those APIs that could let me do that? All of the paypal APIs seem to charge a fee, which would be kind of silly if the money is simply moving between accounts. Any suggestions?
Most banks/organisations will charge I suspect as a vast amount of money made by these organisations is from transfer charges. I cannot think of free api that would let you do it.
However you could consider using another commercial organisation, say like Amazon, and perhaps use it's APIs to supply purchase with gift cards automatically? I'm not saying Amazon is free, I'm just using it as an example.
It's not quite what you want but may be acceptable.
it may not be pretty, but you can use curl to do transactions over https, provided your online bank uses standard html forms in some way, but it typicaly takes 3 processes
1. Login to get a token (user name and password will be required)
2. Use token to get a cookie (in some cases 1 and 2 are reversed)
3. use curl to post the form data for your transaction
There are some good pointers on using curl in similar ways here:
http://curl.haxx.se/docs/httpscripting.html