-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add altcoin buy & renew support #22
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6b2206d
feat: add altcoin buy & renew support
irisdv ff4ef29
fix: do not include user addr in sig verification
irisdv 3f7a65d
test: fix tests
irisdv 2e27f08
fix: quote typing
irisdv 6cd4a04
feat: add altcoin_renew_subscription function
irisdv 10e091f
test: add test for altcoin_renew_subscription
irisdv d97e685
fix: rename to auto_renew_altcoin
irisdv 05c7b03
fix: type quote as Wad
irisdv 962a73e
fix: remove unecessary expiry checks
irisdv 66c9e1a
fix: quote
irisdv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python3 | ||
from starkware.crypto.signature.signature import private_to_stark_key, get_random_private_key, sign | ||
from starknet_py.hash.utils import pedersen_hash | ||
|
||
priv_key = 123 | ||
pub_key = private_to_stark_key(priv_key) | ||
print("pub_key:", hex(pub_key)) | ||
|
||
user_addr = 0x123 | ||
erc20_addr = 0x5 | ||
quote = 591205338160899000000 | ||
max_validity = 1000 | ||
encoded_string = 724720344857006587549020016926517802128122613457935427138661 | ||
data = pedersen_hash(pedersen_hash(pedersen_hash(erc20_addr, quote), max_validity), encoded_string) | ||
|
||
(x, y) = sign(data, priv_key) | ||
print("sig:", hex(x), hex(y)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
mod main; | ||
mod internal; | ||
mod asserts; | ||
mod utils; | ||
mod utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we could drop these two expiry check because the auto renew contract already ensures you can't do something abusive (your domain should expire soon and we can renew only for one year)