I want to create a token for my company, that when ever there is a transaction on chain, a 0.1% of the transaction will send to the company private wallet.

How am I suppose to achieve this?

Thank you

  • Can you be more specific? Are you having trouble implementing a token? Dividing amounts by 1000? Transferring funds to a wallet? – user19510 Jan 22 '18 at 1:22
  • I want to take a part of the transaction. – Alan Li Jan 22 '18 at 2:33
  • Sorry, but this question is too broad/unclear. If you have specific questions during development, please come back and ask them. – user19510 Jan 22 '18 at 2:44

This code is just an example, I made it fast, the order may not be correct.

However, your question is a very basic code logic, not something really related to ethereum itself or solidity. You may try it by yourself before asking for it.

transfer(address from, address to, uint value) public {

uint fees = 10 / 100 * value;

balanceOf[companyAddress] += fees;

uint feesDecucted = value - fees;

balanceOf[to] += feesDeducted;

balanceOf[from]  -= value:

// OD other stuff needed for security and stuff


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