Skip to content

Commit

Permalink
Merge pull request #1230 from radixdlt/feature/radiswap-two-way-linking
Browse files Browse the repository at this point in the history
Feature/radiswap two way linking
  • Loading branch information
iamyulong authored Jul 6, 2023
2 parents 556ede8 + a32317c commit 14cbf5a
Show file tree
Hide file tree
Showing 11 changed files with 663 additions and 33 deletions.
2 changes: 1 addition & 1 deletion radix-engine-common/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ macro_rules! scrypto_args {

#[macro_export]
macro_rules! manifest_args {
($($args: expr),*) => {{
($($args: expr),*$(,)?) => {{
use ::sbor::Encoder;
let mut buf = ::sbor::rust::vec::Vec::new();
let mut encoder = $crate::data::manifest::ManifestEncoder::new(&mut buf, $crate::data::manifest::MANIFEST_SBOR_V1_MAX_DEPTH);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
CALL_METHOD
Address("component_sim1cptxxxxxxxxxfaucetxxxxxxxxx000527798379xxxxxxxxxhkrefh")
"lock_fee"
Decimal("5000")
;
CREATE_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY
Enum<0u8>()
Enum<1u8>()
true
Tuple(
Tuple(
Array<Enum>(),
Array<Tuple>(),
Array<Enum>()
),
Enum<0u8>(
66u8
),
Array<String>()
)
Map<NonFungibleLocalId, Tuple>(
NonFungibleLocalId("#1#") => Tuple(
Tuple()
)
)
Tuple(
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>()
)
Tuple(
Map<String, Tuple>(
"description" => Tuple(
Enum<1u8>(
Enum<0u8>(
"[EXAMPLE] The owner badge for the Radiswap dApp and associated entities"
)
),
false
),
"info_url" => Tuple(
Enum<1u8>(
Enum<13u8>(
"https://radiswap.radixdlt.com/"
)
),
false
),
"name" => Tuple(
Enum<1u8>(
Enum<0u8>(
"Radiswap - dApp Owner Badge"
)
),
false
),
"tags" => Tuple(
Enum<1u8>(
Enum<128u8>(
Array<String>(
"badge",
"dex",
"pool",
"radiswap"
)
)
),
false
)
),
Map<String, Enum>()
)
Enum<0u8>()
;
CALL_METHOD
Address("account_sim129uea6ms5wjstpze559am5ddw293cr2nxeqrha4ae4536dlw5x8whd")
"try_deposit_batch_or_abort"
Expression("ENTIRE_WORKTOP")
;
SET_METADATA
Address("account_sim129uea6ms5wjstpze559am5ddw293cr2nxeqrha4ae4536dlw5x8whd")
"account_type"
Enum<0u8>(
"dapp definition"
)
;
SET_METADATA
Address("account_sim129uea6ms5wjstpze559am5ddw293cr2nxeqrha4ae4536dlw5x8whd")
"name"
Enum<0u8>(
"Radiswap dApp Definition"
)
;
SET_METADATA
Address("account_sim129uea6ms5wjstpze559am5ddw293cr2nxeqrha4ae4536dlw5x8whd")
"description"
Enum<0u8>(
"[EXAMPLE] The Radiswap dApp definition account"
)
;
SET_METADATA
Address("account_sim129uea6ms5wjstpze559am5ddw293cr2nxeqrha4ae4536dlw5x8whd")
"tags"
Enum<128u8>(
Array<String>(
"dex",
"pool",
"radiswap"
)
)
;
SET_METADATA
Address("account_sim129uea6ms5wjstpze559am5ddw293cr2nxeqrha4ae4536dlw5x8whd")
"info_url"
Enum<13u8>(
"https://radiswap.radixdlt.com/"
)
;
SET_METADATA
Address("account_sim129uea6ms5wjstpze559am5ddw293cr2nxeqrha4ae4536dlw5x8whd")
"claimed_websites"
Enum<142u8>(
Array<String>(
"https://radiswap.radixdlt.com"
)
)
;
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PUBLISH_PACKAGE_ADVANCED
Enum<0u8>(
Enum<0u8>(
Enum<0u8>(
NonFungibleGlobalId("resource_sim1nfxxxxxxxxxxsecpsgxxxxxxxxx004638826440xxxxxxxxxwj8qq5:[4bacc54ffcf223a81aac5f9e4fa22fe33a266eb6b372f583daf7252b3e]")
NonFungibleGlobalId("resource_sim1ntkean2wr5ut4uakv85rvamw58thkc93njxwa0j8hyq62u77tgmg94:#1#")
)
)
)
Expand Down Expand Up @@ -650,7 +650,7 @@ PUBLISH_PACKAGE_ADVANCED
"description" => Tuple(
Enum<1u8>(
Enum<0u8>(
"A package of the logic of a Uniswap v2 style DEX."
"[EXAMPLE] A package of the logic of a Uniswap v2 style DEX."
)
),
true
Expand Down Expand Up @@ -684,20 +684,40 @@ CALL_FUNCTION
NamedAddress("radiswap_package")
"Radiswap"
"new"
Enum<0u8>()
Enum<1u8>(
Enum<2u8>(
Enum<0u8>(
Enum<0u8>(
Enum<0u8>(
NonFungibleGlobalId("resource_sim1ntkean2wr5ut4uakv85rvamw58thkc93njxwa0j8hyq62u77tgmg94:#1#")
)
)
)
)
)
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Address("resource_sim1th47ntgk0vvcujeeucmtzhmnch00ems7su7akeszjutt582tqw8cnx")
;
CALL_FUNCTION
NamedAddress("radiswap_package")
"Radiswap"
"new"
Enum<0u8>()
Enum<1u8>(
Enum<2u8>(
Enum<0u8>(
Enum<0u8>(
Enum<0u8>(
NonFungibleGlobalId("resource_sim1ntkean2wr5ut4uakv85rvamw58thkc93njxwa0j8hyq62u77tgmg94:#1#")
)
)
)
)
)
Address("resource_sim1thvtyk4j7ry44p2fq5ucjwfay2n7d9gcl2huyv0hwpj0ffjehs3tcd")
Address("resource_sim1themku2nqm2ktjmz529wr786ckk8cyn9cljhfe8c4c8zqslrkp5dcl")
;
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
Address("account_sim129uea6ms5wjstpze559am5ddw293cr2nxeqrha4ae4536dlw5x8whd")
"try_deposit_batch_or_abort"
Expression("ENTIRE_WORKTOP")
;
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TAKE_ALL_FROM_WORKTOP
Bucket("pool_1_resource_2")
;
CALL_METHOD
Address("component_sim1cqwku3d24lstwsek08ewvv9qdmhm8pt8f7u8jwrzcn7w0jz4rtu60r")
Address("component_sim1cqyd2zdufz4q5nlpghs360g9p6xqvyxxjg90kgcjsfmaynuh8l37yc")
"add_liquidity"
Bucket("pool_1_resource_1")
Bucket("pool_1_resource_2")
Expand All @@ -48,7 +48,7 @@ TAKE_ALL_FROM_WORKTOP
Bucket("pool_2_resource_2")
;
CALL_METHOD
Address("component_sim1cqnla0fn3rzf5meej4p79q73swldyrxjghgwaqnlg430339v5k669v")
Address("component_sim1cqhz2fug707hss8n6evw744g2tgvl0nh7wmex5z3uyzl39c0ynevmq")
"add_liquidity"
Bucket("pool_2_resource_1")
Bucket("pool_2_resource_2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ CALL_METHOD
Address("component_sim1cptxxxxxxxxxfaucetxxxxxxxxx000527798379xxxxxxxxxhkrefh")
"free"
;
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
"try_deposit_batch_or_abort"
Expression("ENTIRE_WORKTOP")
;
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
"withdraw"
Expand Down Expand Up @@ -34,13 +39,13 @@ CALL_METHOD
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
"withdraw"
Address("resource_sim1t4qz77wu6zty77edrm3yngrs8nkwhhj3782zunfakd3zggulmcmqpd")
Address("resource_sim1thal498nmv4ldpz0lvjcvaw9kvy0d3khyd549w7tlc5qmfhcudedlg")
Decimal("333")
;
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
"withdraw"
Address("resource_sim1t57p0xtvaw5u3q25d7m0pk2036w6tgv7t65vam8f2hcrp7c4vn2puh")
Address("resource_sim1thl65g9v2h4axeh9chsqksf6u06qn8r3sls9jfzdepderur83rxv08")
Decimal("333")
;
CALL_METHOD
Expand Down Expand Up @@ -75,13 +80,13 @@ CALL_METHOD
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
"withdraw"
Address("resource_sim1t4qz77wu6zty77edrm3yngrs8nkwhhj3782zunfakd3zggulmcmqpd")
Address("resource_sim1thal498nmv4ldpz0lvjcvaw9kvy0d3khyd549w7tlc5qmfhcudedlg")
Decimal("333")
;
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
"withdraw"
Address("resource_sim1t57p0xtvaw5u3q25d7m0pk2036w6tgv7t65vam8f2hcrp7c4vn2puh")
Address("resource_sim1thl65g9v2h4axeh9chsqksf6u06qn8r3sls9jfzdepderur83rxv08")
Decimal("333")
;
CALL_METHOD
Expand Down Expand Up @@ -116,13 +121,13 @@ CALL_METHOD
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
"withdraw"
Address("resource_sim1t4qz77wu6zty77edrm3yngrs8nkwhhj3782zunfakd3zggulmcmqpd")
Address("resource_sim1thal498nmv4ldpz0lvjcvaw9kvy0d3khyd549w7tlc5qmfhcudedlg")
Decimal("333")
;
CALL_METHOD
Address("account_sim168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf88t3unc0")
"withdraw"
Address("resource_sim1t57p0xtvaw5u3q25d7m0pk2036w6tgv7t65vam8f2hcrp7c4vn2puh")
Address("resource_sim1thl65g9v2h4axeh9chsqksf6u06qn8r3sls9jfzdepderur83rxv08")
Decimal("333")
;
CALL_METHOD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TAKE_ALL_FROM_WORKTOP
Bucket("input")
;
CALL_METHOD
Address("component_sim1cqwku3d24lstwsek08ewvv9qdmhm8pt8f7u8jwrzcn7w0jz4rtu60r")
Address("component_sim1cqyd2zdufz4q5nlpghs360g9p6xqvyxxjg90kgcjsfmaynuh8l37yc")
"swap"
Bucket("input")
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ CALL_METHOD
CALL_METHOD
Address("account_sim168j3paqgngj74yzaljq4n422rtsmupaec3wnqq5425fd85cnd8xmdz")
"withdraw"
Address("resource_sim1t4qz77wu6zty77edrm3yngrs8nkwhhj3782zunfakd3zggulmcmqpd")
Address("resource_sim1thal498nmv4ldpz0lvjcvaw9kvy0d3khyd549w7tlc5qmfhcudedlg")
Decimal("100")
;
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1t4qz77wu6zty77edrm3yngrs8nkwhhj3782zunfakd3zggulmcmqpd")
Address("resource_sim1thal498nmv4ldpz0lvjcvaw9kvy0d3khyd549w7tlc5qmfhcudedlg")
Bucket("pool_units")
;
CALL_METHOD
Address("component_sim1cqwku3d24lstwsek08ewvv9qdmhm8pt8f7u8jwrzcn7w0jz4rtu60r")
Address("component_sim1cqyd2zdufz4q5nlpghs360g9p6xqvyxxjg90kgcjsfmaynuh8l37yc")
"remove_liquidity"
Bucket("pool_units")
;
Expand Down
Loading

0 comments on commit 14cbf5a

Please sign in to comment.