How to increase the total issuance of tokens in the system? - substrate

When the first time I build and run the node-template , in the polkadot ui it Shows
"total issuance
4.6116 MUnit" and I want to increase this. how can I do it.

Basically set some endowed accounts here. https://github.com/paritytech/substrate/blob/master/bin/node/cli/src/chain_spec.rs#L303
Or use root to mint some token in this system. https://github.com/paritytech/substrate/blob/master/frame/balances/src/lib.rs#L314
And there are still a lot of ways to do that. But all of them are done with pallet-balances.

Related

Smart contract to Lock/Hold Solana tokens for a short period

I have a solana program that will transfer some amount. After agreeing to the amount to transfer, the transaction will take place a little later. Few hours to few days. Is there a way my solana smart contract can put a hold/lock kind of enforcement to make sure the funds are available when the transaction takes place ?
You are looking for an escrow smart contract.
One example that is really well explained is this one https://github.com/paul-schaaf/solana-escrow
There are a few existing solutions that will do this for you, including the Bonfida token-vesting program and the Streamflow timelock program.
You can find more information about these programs at https://spl.solana.com/token#token-vesting
The idea is to move the tokens to an account owned by the timelock / vesting program, and then these funds are unblocked after a certain amount of time.

Taking remote orders via app

I have small food store. I'm working on an app that will allow my customers to download the app, keep up with events, etc., but most importantly, order from my app menu ahead of time, take their CC payment ahead of time and I have their order waiting for them when they walk in. I want the purchase to now show up in my Square system so I can get started on the order and I would like to use Square POS to take and process the order so I don't have to keep up with two POS systems. This does not seem possible with Square? Suggestions, idea, help?
To my knowledge, that isn't currently possible with any of the available Square APIs. The best you can do is probably to set up a Square online store and allow users to make purchases from your site. Masala Wok is a good example of what this looks like.

Google authenticator expiration time (or drift?)

I'm using a gem to enable google's multi factor authentication for my app. https://github.com/jaredonline/google-authenticator
We want to start using text messages to make this a bit more accessible, and I was wondering if anyone knew if you could control the expiration of the tokens? Would bumping the drift up to 300 seconds work? Just curious if anyone else has encountered this. Thanks!
Basically, yes.
You can't change the length of a GA token (must be 30 seconds) but the drift will let you set a window for how much older a token can be. The underlying ROTP library will compute all tokens over the time window and succeed if any match.
But you probably don't want a window that high. The security comes from the user and the site being (mostly) in sync. You should account for a bit of drift between your server and the user's device, but anything much more than ~30 seconds is going to mostly be to your users' detriment. It's a 6 digit number -- it shouldn't take 5 minutes to key in.

Is there a file updated always in the windows system, which update includes the time information?

I am programming a 30-Day-trial application, I need to make sure if the user changes the system time it will not harm my application and the 30-day-trial will still be calculated, or at least I will be able to figure he did something wrong.
The best way I found is to check for a system file which its contents updated and every update contains the time with its data, so I can find out if the user changes the date or not, by comparing the dates with each other ...
I know it is not certain way, but it is kind of make it harder and shrink the area of who can crack it.
I found about Event log
windows7 log files
it can help..
Any solution proposed can be hacked. But it sounds like you only want to ward off the casual pirate, not the determined hacker.
Instead of trusting the system clock, how about just making a network request back to your own website or time server to get the current date and time?
Another idea is to just limit the number of times the application can be launched instead of limiting it to a specific amount of time.

How to prevent time-based cheats on a time-based simulation game?

In the iphone game "Tiny Tower", I'm guessing it uses some kind of simulation based on the time spent between the last play and the current time, because you can set the current time forward and you will get the benefit from the fake elapsed time span.
Is there an algorithm that I can use to prevent this sort of thing? (Or at least make it difficult enough for the average user to pull off!)
Edit: thanks, I understand that, despite my wording, there's no way to prevent things you store on the client side, but I want to make it at least more difficult than "changing the time" to hack it!
The gamecube had a way to do this so it must be possible.
Is there an event triggered when the iphone time is set ? In that case you can react that.
Another solution is to require to be online when the game is launched, this way you can check time on a remote server.
You could has well check if you got an event on the phone login or wake up react to it, saving the time at that moment in your DB. You would have the last non modified time.
A last possible trick is to check for a file you know is going to be modified by an action prior to time change (such as login), and check the 'last modification' date.
You can investigate in the GPS direction as well. A GPS need to be synchronised with the satellite it contact, so it must keep track of time in some way, and maybe there is an API for that.
Unfortunatly you are on an iphone, which mean your possibilities are limited since applications got very few rights and are sandboxed.
EDIT:
Just though about it but, can you create event in the iphone calendar ? And check if it has been trigered ? Cause you could set a fake meeting or something for every day. Not clean, but creative.
EDIT 2: can you set a timer as a code for IOS to execute in 60 minutes ? If you can, set this timer, pass the time expected to be when this code run, then when the code run, compare and inform your program.
One way to prevent it is to monitor time passing by checking timestamps for their logins in a database. It doesn't matter if the client's iPhone's time is off; the database on your end will still know how long it's been since the last login.
I think if you have internet access you can take the time from a server.
A second solution : You can record the "datetime" and every time you see a "BIG" difference between the record datetime and the running datetime you know there might be a problem.
but this is not elegant, i know.
You can also record a small ammount of datetimes that the application started and check the diffrence with the running datetime.
Also you can use "Activity"->"Datetime" so the "Updates" (levels etc) can't be retaken.
Because the system Datetime can be changed by user, there is potential for "hack".
call a web service to get the time, rather than rely on the phone. There are several places you could get time from, google is your friend i'm sure, or create one yourself, and use the local time of the machine the service runs on for the time.
You could also use the Network Time Protocol (NTP) servers to get a consistent time

Resources