0

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

closed as unclear what you're asking by user19510, Achala Dissanayake, Richard Horrocks, flygoing, debris Jan 23 '18 at 9:48

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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
1

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.