How to transfer back tokens sent to the crowdsale?

i have an already deployed token with supply, i transferred tokens to the crowdsale contract i made,

now how do i get the tokens back from this crowdsale contract? should i use allowanceCrowdsale? what options do i have?

1 Like

Hi @Farhan_W,

Welcome to the community :wave:.

If you transferred tokens to a crowdsale contract you can only transfer them back if:

  • Your crowdsale contract has functionality to withdraw tokens or
  • You purchase the tokens using the crowdsale

Assuming you haven’t created functionality to withdraw tokens, then your option is to purchase the tokens using the crowdsale yourself, assuming that the funds raised from the crowdsale are accessible to you.

Hi
Thanks for the quick response.
I am still making and testing the crowdsale contract on ropsten testnet. so i can add the function to withdraw tokens. can you please tell me a simple function to withdraw tokens or send back to contract deployer address?

1 Like

Hi @Farhan_W,

If you are not planning to sell all of the tokens held by a crowdsale then an AllowanceCrowdsale is probably best.

Otherwise you can create a withdrawTokens function that can only be called by a specific role that does a transfer of the token to a specified address.

Got it. Thank You. I have read a lot of your solutions in this forum and i wanted to say you are wonderful. Thank you for your help to community.

1 Like