some smart contracts also burn BNB in some conditions
Why
To make deflation
How
Send tokens to an address without a private key, which means no one can access the tokens anymore.
BEP-95
Why
To fasten the burn efficiency.
How
Since the solution is to burn partial of validators’ reward, the more users use BSC (which means more blocks need to be validated by validators), the more BNB would be burned.
Auto-Burn
Rule
The more the price of BNB decreases, the more BNB will be burned.
When the total supply is lower than 1B, the burn process stops (BEP-95 still works).
If you use login as root, or other users with LOCK TABLE, and PROCESS privileges, you can skip this step.
Quote from the document:
mysqldump requires at least the SELECT privilege for dumped tables, SHOW VIEW for dumped views, TRIGGER for dumped triggers, LOCK TABLES if the –single-transaction option is not used, and (as of MySQL 8.0.21) PROCESS if the –no-tablespaces option is not used. Certain options might require other privileges as noted in the option descriptions.
Now you can run composer database-update to sync the data, or just execute .vendor/waelwalid/laravel-database-sync/database-update.sh which is the same, cheers :)
I got a mission to clone an existing service, which has its database separately from the original.
Here is my to-do list:
create tables
sync data
This article will only record the first step. the next step will be written in the second episode.
How to create tables from the existing database
Since this project is a Laravel app, but without migration files so I came out with 2 solutions:
Create migrations from the existing database, then run php artisan migrate to create the same tables to my new database
Create create-table-SQLs from the existing database, then somehow run these SQLs
Migration Generator
I thought the first one is more ideal since it is easier for other developers to maintain so I googled “laravel create migration …” then google returned me a bunch of packages to do these tasks, nice!
So I generated all the migrations in seconds, lovely! Then I run php artisan migrate!
CRASH!
Checked out the migrations, found that the generator didn’t generate the codes properly. It missed some details, like lacking index, so I needed to go through each file to debug… which was not my purpose to use a tool so I tried the second solution, create tables by pure SQL
I test a table and it worked properly, created exactly same table as the original without error
Implement
So I exported the table structure in SQL from phpMyAdmin manually (the total number of tables is still acceptable for me to do this).
Instead of creating a command to do this task, I still generated migrations matched to the tables since I would like to have the ROLLBACK feature in Laravel migration. Remember? We can create migrations in seconds by using one of the mentioned packages. Don’t forget to edit .env to switch to the original database, And after generating, switch back to the NEW database.
Here is my migration code. I put all the SQL in database/sql_migrations but you can put them anywhere you like.