Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit order TEAL template #101

Merged
merged 9 commits into from
Jan 6, 2020
Merged

Limit order TEAL template #101

merged 9 commits into from
Jan 6, 2020

Conversation

EvanJRichard
Copy link
Contributor

Summary

This template implements limit-order-a.teal.impl from go-algorand.

Testing

Automatic unit/sdk testing. Added a golden test for program and address.

See also

#98

@EvanJRichard EvanJRichard self-assigned this Dec 6, 2019
}

// MakeLimitOrder allows a user to exchange some number of N assets for D algos.
// This is a contract account.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit of a weird comment here that makes much more sense in the TEAL code.

return signedGroup, nil
}

// MakeLimitOrder allows a user to exchange some number of N assets for D algos.
Copy link
Contributor

Choose a reason for hiding this comment

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

This line and line 75 are contradicting

// the first payment sends money (Algos) from contract to the recipient (we'll call him Buyer), closing the rest of the account to Owner
// the second payment sends money (the asset) from Buyer to the Owner
// these transactions will be rejected if they do not meet the restrictions set by the contract
func (lo LimitOrder) GetSwapAssetsTransaction(assetAmount uint64, contract, secretKey []byte, fee, algoAmount, firstRound, lastRound uint64, genesisHash []byte) ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This one does the correct thing!

Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably rename algoAmount to microAlgoAmount

@EvanJRichard EvanJRichard merged commit bc0af1a into master Jan 6, 2020
@EvanJRichard EvanJRichard deleted the evan/limitorder branch January 6, 2020 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants