-
Notifications
You must be signed in to change notification settings - Fork 90
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
Conversation
…sed quite yet, add them back in when we need them
templates/limitOrder.go
Outdated
} | ||
|
||
// MakeLimitOrder allows a user to exchange some number of N assets for D algos. | ||
// This is a contract account. |
There was a problem hiding this comment.
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.
templates/limitOrder.go
Outdated
return signedGroup, nil | ||
} | ||
|
||
// MakeLimitOrder allows a user to exchange some number of N assets for D algos. |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
Summary
This template implements
limit-order-a.teal.impl
fromgo-algorand
.Testing
Automatic unit/sdk testing. Added a golden test for program and address.
See also
#98