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

Ageusd implementation #158

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
56d1c77
EIP-15 AgeUsdBank implementation: Price calculations
MrStahlfelge Apr 9, 2022
a9c9257
EIP-15 AgeUsdBank implementation: build tx stub
MrStahlfelge Apr 9, 2022
7b77aba
BlockchainDataSource add getUnspentBoxesFor token, BoxOperations miss…
MrStahlfelge Apr 11, 2022
1abb7ab
EIP-15 AgeUSD: build exchange transactions
MrStahlfelge Apr 13, 2022
f596b17
EIP-15 AgeUSD: add test for additional fee
MrStahlfelge Apr 13, 2022
ec60d2b
AgeUSDBank fix reserve ratio calculation, add getStableCoinAmountAva…
MrStahlfelge Apr 16, 2022
662bfc8
AgeUSDBank fix getReserveCoinPrice(), harden getReserveRatio()
MrStahlfelge Apr 16, 2022
aad71c6
Merge branch 'eip29' into ageusd
MrStahlfelge Apr 21, 2022
44ed752
AgeUsdExchangeTransactionBuilder: can use client-defined rate and ban…
MrStahlfelge Apr 21, 2022
5e6a868
Merge remote-tracking branch 'origin/develop' into ageusd
MrStahlfelge Apr 25, 2022
5473f9a
AgeUsdExchangeTransactionBuilder: apply DefaultBoxSelector to bypass …
MrStahlfelge Apr 30, 2022
f86efd7
Merge branch 'develop' into ageusd
MrStahlfelge May 9, 2022
a7b46ed
Merge remote-tracking branch 'origin/develop' into ageusd
MrStahlfelge May 18, 2022
9a98744
Merge remote-tracking branch 'origin/develop' into ageusd
MrStahlfelge Jul 29, 2022
49c8760
Merge remote-tracking branch 'origin/develop' into ageusd
MrStahlfelge Aug 29, 2022
4807f59
AgeUsdBank constructor for Node API types, AgeUsdExchangeTransactionB…
MrStahlfelge Sep 24, 2022
fa69990
AgeUsdExchangeTransactionBuilder pay tx fee from receipt when selling
MrStahlfelge Sep 26, 2022
4269b19
Merge remote-tracking branch 'origin/develop' into ageusd
MrStahlfelge Nov 11, 2022
4df5377
EIP-15 AgeUsdExchangeTransactionBuilder adapt to new methods in Appkit
MrStahlfelge Nov 11, 2022
690bcf4
Merge branch 'new-blockchain-api' into ageusd
MrStahlfelge Feb 27, 2023
4d9d848
Merge branch 'develop' into ageusd
MrStahlfelge May 4, 2023
31857ef
Adapted test
MrStahlfelge May 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"items": [
{
"boxId": "2342c916b272d8ede91da7e00bd3029f41beaa742bc75af3976916600de64f98",
"transactionId": "4bfb000123026edec42cf7252206a3aaf0b089af80d992f461322d1e1ec107d3",
"blockId": "15f39c5e65a0cdba80d4d01d925e12eaac01fabb58127423c0d5b7919a604833",
"value": 1458253206733705,
"index": 0,
"globalIndex": 15490910,
"creationHeight": 727025,
"settlementHeight": 727027,
"ergoTree": "102a0400040004000e20011d3364de07e5a26f0c4eef0852cddb387039a921b7154ef3cab22c6eda887f0400040204020400040004020500050005c8010500050005feffffffffffffffff0105000580897a05000580897a040405c80104c0933805c00c0580a8d6b907050005c8010580dac40905000500040404040500050005a0060101050005a0060100040004000e20239c170b7e82f94e6b05416f14b8a2a57e0bfff0e3c93f4abbcd160b6a5b271ad801d601db6501fed1ec9591b172017300d821d602b27201730100d603938cb2db63087202730200017303d604b2a5730400d605c17204d606db6308a7d607b27206730500d6088c720702d609db63087204d60ab27209730600d60b8c720a02d60c947208720bd60db27206730700d60e8c720d02d60fb27209730800d6108c720f02d61194720e7210d612e4c6a70505d613e4c672040505d614e4c6a70405d615e4c672040405d616b2a5730900d617e4c672160405d61895720c730a7217d61995720c7217730bd61ac1a7d61be4c672160505d61c9de4c672020405730cd61da2a1721a9c7214721c730dd61e9572119ca1721c95937214730e730f9d721d72147218d801d61e99721a721d9c9593721e7310731195937212731273139d721e72127219d61f9d9c721e7e7314057315d6209c7215721cd6219591a3731673177318d62295937220731972219d9c7205731a7220edededed7203ededededed927205731b93c27204c2a7edec720c7211efed720c7211ed939a720872129a720b7213939a720e72149a72107215edededed939a721472187215939a721272197213939a721a721b7205927215731c927213731deded938c720f018c720d01938c720a018c720701938cb27209731e00018cb27206731f000193721b9a721e958f721f7320f0721f721f957211959172187321927222732273239591721973249072227221927222732572037326938cb2db6308b2a4732700732800017329",
"address": "MUbV38YgqHy7XbsoXWF5z7EZm524Ybdwe5p9WDrbhruZRtehkRPT92imXer2eTkjwPDfboa1pR3zb3deVKVq3H7Xt98qcTqLuSBSbHb7izzo5jphEpcnqyKJ2xhmpNPVvmtbdJNdvdopPrHHDBbAGGeW7XYTQwEeoRfosXzcDtiGgw97b2aqjTsNFmZk7khBEQywjYfmoDc9nUCJMZ3vbSspnYo3LarLe55mh2Np8MNJqUN9APA6XkhZCrTTDRZb1B4krgFY1sVMswg2ceqguZRvC9pqt3tUUxmSnB24N6dowfVJKhLXwHPbrkHViBv1AKAJTmEaQW2DN1fRmD9ypXxZk8GXmYtxTtrj3BiunQ4qzUCu1eGzxSREjpkFSi2ATLSSDqUwxtRz639sHM6Lav4axoJNPCHbY8pvuBKUxgnGRex8LEGM8DeEJwaJCaoy8dBw9Lz49nq5mSsXLeoC4xpTUmp47Bh7GAZtwkaNreCu74m9rcZ8Di4w1cmdsiK1NWuDh9pJ2Bv7u3EfcurHFVqCkT3P86JUbKnXeNxCypfrWsFuYNKYqmjsix82g9vWcGMmAcu5nagxD4iET86iE2tMMfZZ5vqZNvntQswJyQqv2Wc6MTh4jQx1q2qJZCQe4QdEK63meTGbZNNKMctHQbp3gRkZYNrBtxQyVtNLR8xEY8zGp85GeQKbb37vqLXxRpGiigAdMe3XZA4hhYPmAAU5hpSMYaRAjtvvMT3bNiHRACGrfjvSsEG9G2zY5in2YWz5X9zXQLGTYRsQ4uNFkYoQRCBdjNxGv6R58Xq74zCgt19TxYZ87gPWxkXpWwTaHogG1eps8WXt8QzwJ9rVx6Vu9a5GjtcGsQxHovWmYixgBU8X9fPNJ9UQhYyAWbjtRSuVBtDAmoV1gCBEPwnYVP5GCGhCocbwoYhZkZjFZy6ws4uxVLid3FxuvhWvQrVEDYp7WRvGXbNdCbcSXnbeTrPMey1WPaXX",
"assets": [
{
"tokenId": "03faf2cb329f2e90d6d23b58d91bbb6c046aa143261cc21f52fbe2824bfcbf04",
"index": 0,
"amount": 9999844128263,
"name": "SigUSD",
"decimals": 2,
"type": "EIP-004"
},
{
"tokenId": "003bd19d0187117f130b62e1bcab0939929ff5c7709f843c5c4dd158949285d0",
"index": 1,
"amount": 9998636056232,
"name": "SigRSV",
"decimals": 0,
"type": "EIP-004"
},
{
"tokenId": "7d672d1def471720ca5782fd6473e47e796d9ac0c138d9911346f118b2f6d9d9",
"index": 2,
"amount": 1,
"name": "SUSD Bank V2 NFT",
"decimals": 0,
"type": "EIP-004"
}
],
"additionalRegisters": {
"R4": {
"serializedValue": "05f4a7d39401",
"sigmaType": "SLong",
"renderedValue": "155871738"
},
"R5": {
"serializedValue": "05b285e1940a",
"sigmaType": "SLong",
"renderedValue": "1363943769"
}
},
"spentTransactionId": null,
"mainChain": true
}
],
"total": 1

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{

"items": [
{
"boxId": "390a8fe7875910ba2fa7d836235afa10b81e878ccac9c5d61b3a3a5ab879560b",
"transactionId": "33ad33a0f81af1422ce784b10900cba682bbbffb4ff4fad3db76d3c9592490cb",
"blockId": "093ee04f0c8249963baa1c382787e9b8696cdfd5528d749722e5c78b47871c0d",
"value": 3471500000,
"index": 0,
"globalIndex": 15493690,
"creationHeight": 727095,
"settlementHeight": 727097,
"ergoTree": "1014040004000e208c27dd9d8a35aac1e3167d58858c0a8b4059b277da790552e37eba22df9b903504000400040204020101040205a0c21e040204080500040c040204a0c21e0402050a05c8010402d806d601b2a5730000d602b5db6501fed9010263ed93e4c67202050ec5a7938cb2db63087202730100017302d603b17202d604e4c6b272027303000605d605d90105049590720573047204e4c6b272029972057305000605d606b07202860273067307d901063c400163d803d6088c720601d6098c720801d60a8c72060286029a72097308ededed8c72080293c2b2a5720900d0cde4c6720a040792c1b2a5720900730992da720501997209730ae4c6720a0605ea02d1ededededededed93cbc27201e4c6a7060e927203730b93db63087201db6308a793e4c6720104059db07202730cd9010741639a8c720701e4c68c72070206057e72030593e4c6720105049ae4c6a70504730d92c1720199c1a77e9c9a7203730e730f058c72060292da720501998c72060173109972049d9c720473117312b2ad7202d9010763cde4c672070407e4c6b2a5731300040400",
"address": "NTkuk55NdwCXkF1e2nCABxq7bHjtinX3wH13zYPZ6qYT71dCoZBe1gZkh9FAr7GeHo2EpFoibzpNQmoi89atUjKRrhZEYrTapdtXrWU4kq319oY7BEWmtmRU9cMohX69XMuxJjJP5hRM8WQLfFnffbjshhEP3ck9CKVEkFRw1JDYkqVke2JVqoMED5yxLVkScbBUiJJLWq9BSbE1JJmmreNVskmWNxWE6V7ksKPxFMoqh1SVePh3UWAaBgGQRZ7TWf4dTBF5KMVHmRXzmQqEu2Fz2yeSLy23sM3pfqa78VuvoFHnTFXYFFxn3DNttxwq3EU3Zv25SmgrWjLKiZjFcEcqGgH6DJ9FZ1DfucVtTXwyDJutY3ksUBaEStRxoUQyRu4EhDobixL3PUWRcxaRJ8JKA9b64ALErGepRHkAoVmS8DaE6VbroskyMuhkTo7LbrzhTyJbqKurEzoEfhYxus7bMpLTePgKcktgRRyB7MjVxjSpxWzZedvzbjzZaHLZLkWZESk1WtdM25My33wtVLNXiTvficEUbjA23sNd24pv1YQ72nY1aqUHa2",
"assets": [
{
"tokenId": "011d3364de07e5a26f0c4eef0852cddb387039a921b7154ef3cab22c6eda887f",
"index": 0,
"amount": 1,
"name": "ERGUSD-NFT",
"decimals": 0,
"type": "EIP-004"
}
],
"additionalRegisters": {
"R4": {
"serializedValue": "0584e19fdc01",
"sigmaType": "SLong",
"renderedValue": "230946882"
},
"R5": {
"serializedValue": "04fee058",
"sigmaType": "SInt",
"renderedValue": "727103"
},
"R6": {
"serializedValue": "0e20f7ef73c4a4ab91b84bb0a2905108d534114472ec057be3a57a9dfc9b1fbd85c1",
"sigmaType": "Coll[SByte]",
"renderedValue": "f7ef73c4a4ab91b84bb0a2905108d534114472ec057be3a57a9dfc9b1fbd85c1"
}
},
"spentTransactionId": null,
"mainChain": true
}
],
"total": 1

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"items": [
{
"boxId": "976c21fbd859cca4113a0711706c33b3d1f1052958a0196d61480f4b950fdf91",
"transactionId": "093eb4a9a963d52a304cb0f8f8150775854a55bd59db8b797fc2ae4d525dba65",
"blockId": "54406fd13168c6be1f4306e5d7b896783c12223e043e7ef2cc189bc72e6ee39e",
"value": 400000000981000000,
"creationHeight": 130509,
"settlementHeight": 505913,
"ergoTree": "0008cd02472963123ce32c057907c7a7268bc09f45d9ca57819d3327b9e7497d7b1cc347",
"address": "9hHDQb26AjnJUXxcqriqY1mnhpLuUeC81C4pggtK7tupr92Ea1K",
"assets": [
{
"tokenId": "03faf2cb329f2e90d6d23b58d91bbb6c046aa143261cc21f52fbe2824bfcbf04",
"index": 0,
"amount": 1000,
"name": "SigUSD",
"decimals": 2,
"type": "EIP-004"
},
{
"tokenId": "003bd19d0187117f130b62e1bcab0939929ff5c7709f843c5c4dd158949285d0",
"index": 1,
"amount": 1000000000000,
"name": "SigRSV",
"decimals": 0,
"type": "EIP-004"
}
],
"additionalRegisters": {},
"spentTransactionId": null,
"mainChain": true
}
],
"total": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"boxId": "976c21fbd859cca4113a0711706c33b3d1f1052958a0196d61480f4b950fdf91",
"value": 400000000981000000,
"ergoTree": "0008cd036ba5cfbc03ea2471fdf02737f64dbcd58c34461a7ec1e586dcd713dacbf89a12",
"creationHeight": 130509,
"assets": [
{
"tokenId": "03faf2cb329f2e90d6d23b58d91bbb6c046aa143261cc21f52fbe2824bfcbf04",
"amount": 1000
},
{
"tokenId": "003bd19d0187117f130b62e1bcab0939929ff5c7709f843c5c4dd158949285d0",
"amount": 1000000000000
}
],
"additionalRegisters": {},
"transactionId": "c5710af17f5124a232a5ef731fdf94a493025334c2a7d5a79e9923210972b962",
"index": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{

"boxId": "2342c916b272d8ede91da7e00bd3029f41beaa742bc75af3976916600de64f98",
"value": 1458253206733705,
"ergoTree": "102a0400040004000e20011d3364de07e5a26f0c4eef0852cddb387039a921b7154ef3cab22c6eda887f0400040204020400040004020500050005c8010500050005feffffffffffffffff0105000580897a05000580897a040405c80104c0933805c00c0580a8d6b907050005c8010580dac40905000500040404040500050005a0060101050005a0060100040004000e20239c170b7e82f94e6b05416f14b8a2a57e0bfff0e3c93f4abbcd160b6a5b271ad801d601db6501fed1ec9591b172017300d821d602b27201730100d603938cb2db63087202730200017303d604b2a5730400d605c17204d606db6308a7d607b27206730500d6088c720702d609db63087204d60ab27209730600d60b8c720a02d60c947208720bd60db27206730700d60e8c720d02d60fb27209730800d6108c720f02d61194720e7210d612e4c6a70505d613e4c672040505d614e4c6a70405d615e4c672040405d616b2a5730900d617e4c672160405d61895720c730a7217d61995720c7217730bd61ac1a7d61be4c672160505d61c9de4c672020405730cd61da2a1721a9c7214721c730dd61e9572119ca1721c95937214730e730f9d721d72147218d801d61e99721a721d9c9593721e7310731195937212731273139d721e72127219d61f9d9c721e7e7314057315d6209c7215721cd6219591a3731673177318d62295937220731972219d9c7205731a7220edededed7203ededededed927205731b93c27204c2a7edec720c7211efed720c7211ed939a720872129a720b7213939a720e72149a72107215edededed939a721472187215939a721272197213939a721a721b7205927215731c927213731deded938c720f018c720d01938c720a018c720701938cb27209731e00018cb27206731f000193721b9a721e958f721f7320f0721f721f957211959172187321927222732273239591721973249072227221927222732572037326938cb2db6308b2a4732700732800017329",
"assets": [
{
"tokenId": "03faf2cb329f2e90d6d23b58d91bbb6c046aa143261cc21f52fbe2824bfcbf04",
"amount": 9999844128263
},
{
"tokenId": "003bd19d0187117f130b62e1bcab0939929ff5c7709f843c5c4dd158949285d0",
"amount": 9998636056232
},
{
"tokenId": "7d672d1def471720ca5782fd6473e47e796d9ac0c138d9911346f118b2f6d9d9",
"amount": 1
}
],
"creationHeight": 727025,
"additionalRegisters": {
"R4": "05f4a7d39401",
"R5": "05b285e1940a"
},
"transactionId": "4bfb000123026edec42cf7252206a3aaf0b089af80d992f461322d1e1ec107d3",
"index": 0

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{

"boxId": "390a8fe7875910ba2fa7d836235afa10b81e878ccac9c5d61b3a3a5ab879560b",
"value": 3471500000,
"ergoTree": "1014040004000e208c27dd9d8a35aac1e3167d58858c0a8b4059b277da790552e37eba22df9b903504000400040204020101040205a0c21e040204080500040c040204a0c21e0402050a05c8010402d806d601b2a5730000d602b5db6501fed9010263ed93e4c67202050ec5a7938cb2db63087202730100017302d603b17202d604e4c6b272027303000605d605d90105049590720573047204e4c6b272029972057305000605d606b07202860273067307d901063c400163d803d6088c720601d6098c720801d60a8c72060286029a72097308ededed8c72080293c2b2a5720900d0cde4c6720a040792c1b2a5720900730992da720501997209730ae4c6720a0605ea02d1ededededededed93cbc27201e4c6a7060e927203730b93db63087201db6308a793e4c6720104059db07202730cd9010741639a8c720701e4c68c72070206057e72030593e4c6720105049ae4c6a70504730d92c1720199c1a77e9c9a7203730e730f058c72060292da720501998c72060173109972049d9c720473117312b2ad7202d9010763cde4c672070407e4c6b2a5731300040400",
"assets": [
{
"tokenId": "011d3364de07e5a26f0c4eef0852cddb387039a921b7154ef3cab22c6eda887f",
"amount": 1
}
],
"creationHeight": 727095,
"additionalRegisters": {
"R4": "0584e19fdc01",
"R5": "04fee058",
"R6": "0e20f7ef73c4a4ab91b84bb0a2905108d534114472ec057be3a57a9dfc9b1fbd85c1"
},
"transactionId": "33ad33a0f81af1422ce784b10900cba682bbbffb4ff4fad3db76d3c9592490cb",
"index": 0

}
Loading