Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Victor example changes #117

Merged
merged 20 commits into from
Jun 27, 2019
Merged

Victor example changes #117

merged 20 commits into from
Jun 27, 2019

Conversation

onigiri-x
Copy link
Contributor

No description provided.

// Get some poly tokens in your account and the security token
// Poly token faucet works on test net
await polymathAPI.getPolyTokens({ amount: new BigNumber(1000000) });
await polymathAPI.polyToken.transfer({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my bad. You don't need to transfer. You only need to approve as you are doing below, then the ST calls transferFrom. So this entire line is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I tested it and saw that, I will go ahead and just remove that transfer from my files

const myAddress = await polymathAPI.getAccount();
// Token faucet on test net only
await polymathAPI.getPolyTokens({ amount: new BigNumber(1000000), address: myAddress });
await polymathAPI.polyToken.transfer({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. You don't need to transfer. You only need to approve as you are doing below, then the ST calls transferFrom. So this entire line is not needed.

moduleName: ModuleName.erc20DividendCheckpoint,
}))[0];

await polymathAPI.polyToken.transfer({ to: erc20Dividend, value: new BigNumber(5) });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to transfer, with the approve from next line is ok.

address: await polymathAPI.securityTokenRegistry.address(),
const myAddress = await polymathAPI.getAccount();
await polymathAPI.getPolyTokens({ amount: new BigNumber(1000000), address: myAddress });
await polymathAPI.polyToken.transfer({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. You don't need to transfer. You only need to approve as you are doing below, then the ST calls transferFrom. So this entire line is not needed.

// Get some poly tokens in your account and the security token
const myAddress = await polymathAPI.getAccount();
await polymathAPI.getPolyTokens({ amount: new BigNumber(1000000), address: myAddress });
await polymathAPI.polyToken.transfer({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. You don't need to transfer. You only need to approve as you are doing below, then the ST calls transferFrom. So this entire line is not needed.

// Get some poly tokens in your account and the security token
const myAddress = await polymathAPI.getAccount();
await polymathAPI.getPolyTokens({ amount: new BigNumber(1000000), address: myAddress });
await polymathAPI.polyToken.transfer({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. You don't need to transfer. You only need to approve as you are doing below, then the ST calls transferFrom. So this entire line is not needed.

address: await polymathAPI.securityTokenRegistry.address(),
const myAddress = await polymathAPI.getAccount();
await polymathAPI.getPolyTokens({ amount: new BigNumber(1000000), address: myAddress });
await polymathAPI.polyToken.transfer({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. You don't need to transfer. You only need to approve as you are doing below, then the ST calls transferFrom. So this entire line is not needed.

address: await polymathAPI.securityTokenRegistry.address(),
const myAddress = await polymathAPI.getAccount();
await polymathAPI.getPolyTokens({ amount: new BigNumber(1000000), address: myAddress });
await polymathAPI.polyToken.transfer({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. You don't need to transfer. You only need to approve as you are doing below, then the ST calls transferFrom. So this entire line is not needed.

@VictorVicente VictorVicente merged commit 2b6665e into examples-code Jun 27, 2019
@VictorVicente VictorVicente deleted the victor-example-changes branch June 27, 2019 12:32
@shivamagl95
Copy link
Contributor

🎉 This PR is included in version 2.1.0-beta.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants