1

In my use case, I want to build a local currency system with solidity. The core concept of local currency is that the currency can only be used in the specific region. It aims to encourage spending within a local community, especially with locally owned businesses.

So my question is that how can I restrict the token only be transferred within the region. It means that the function 'transfer(address, amount)' will be reverted when the user calls the function outside the region.

2

One way you could achieve that is by:

  1. Creating a whitelist of addresses that will be the only ones to transfer your local currency
  2. Overriding transfer() to restrict transfers from/to users within the whitelist.

In any case, you need an external procedure (off-chain) to determine which users belong to your region, or in other words, you need a centralised way to determine who can operate within your decentralised system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.