0

In general, token-payer(=msg.sender) receive service from smartcontract. Is it possible to seperate token payer from service-consumer with special contract and general smartcontract above? It means token-payer is user A (or contract) but service-consumer is user B. Token is erc20.

0

In my opinion, yes this is possible but, no, it is not necessary or desirable to add complexity to a token contract or, generally, opinions about how to use it.

Think of the token contract as the defining document that describes the minimum important properties such as supply, symbol, contract address, minimal account (where are they?) and minimal functions such as transfer.

That is, one doesn't redesign the federal reserve note for every novel business idea or vending machine design, but the notes themselves impose any opinions about a business should work - separate concerns.

Contract B can be the consumer that receives instructions from user A.

Hope it helps.

3
  • I dont want to add complexity to token contract. It is just erc20 standard. In this case, I guess it is important to add new smartcontract that makes logic feasible and I am asking how to make smartcontract.
    – ikaop
    May 29 '19 at 4:41
  • The design will be simplified with ERC223 which can signal contract B when it receives tokens, then contract B will do whatever it does. ERC223 is backward compatible with ERC20. It has an additional function, the tokenFallback() function. May 29 '19 at 4:56
  • "how to make smartcontract" is too broad to know what else about the process to focus on for you. May 29 '19 at 14:50

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .