{"id":"jvNB_oogBb8","title":"Cross Ecosystem Communication between Aurora and NEAR - Michael Birch - Near Day at ETHDenver 2023","description":"Join NEAR's community:\nWebsite: https://near.org/\nReddit:   / nearprotocol  \nDiscord: https://near.chat/\nMedium:   / nearprotocol  \nBlog: https://near.org/blog/\nTwitter:   / nearprotocol  \nGitHub: https://github.com/near  https://github.com/nearprotocol\nDev Docs: https://docs.near.org/\nCreate a wallet: https://wallet.near.org/create\nApps on NEAR: https://awesomenear.com/\nLearn to Build On NEAR: https://www.near.university/\nGrants & Funding: https://near.org/grants/\n#Blockchain #FutureisNEAR #NEAR #nearprotocol\n#nft #dao","channel_name":"NEAR Protocol","published_at":"2023-03-17T00:00:00.000Z","thumbnail_url":"https://img.youtube.com/vi/jvNB_oogBb8/hqdefault.jpg","transcript_text":"so if I'm a developer and I want to make use of this how do I do it well we've got a brand new open source GitHub repository the Aurora contracts SDK this is a QR code here that'll take you right to that repository this includes a rust library for your near contracts to be able to interact with Aurora and it includes a solidity library for your evm contracts to interact with near so this is covering both sides of that communication and it also includes documentation and examples so that you can get to know this Library figure out how to use them and integrate it into your own projects so let's go ahead and take a look at some of those examples right now so the first example we're going to look at is a solidity example this is a AVM contract that is deployed on Aurora but it's going to call the Social DB deployed on near now social DB is the storage layer that backs the near dot social decentralized social media platform which is a super cool thing in its own right but what we're going to do here is call it from Aurora and that could enable for example a metamask based entry point into the near dot social network and that could could be super cool itself so this is a high level sketch of what the example is doing right so we've got our evm contract deployed on Aurora and it's going to be calling the set function which is uh on the social DB contract deployed on near and we're going to include a callback back to the evm so that we can get the result of that call now the the set method on on social DB is exactly how you store data in in the contract so again you could try to use this for example to try to build a metamask or other ethereum wallet-based entry point into near social so okay so what does this code look like well it looks just like normal solidity code you've got your contract definition you're using an open Zeppelin library and access control which tons of people will be familiar with here and all you have to do is add in the Aurora SDK library for the near related pieces that you want to use so for example this is the definition of that set function call right so we have this nice near dot call command or function method in the SDK you can see it takes the the account that we want to call the method we want to call on it what data we want the near and gas that we need to attach to that call and attaching near is important so that we can cover the storage that we're incurring in the social DB contract but what's super cool about this is the cross contract calls feature is making everything seamless in between these two sides so inside the evm the attached near you're using is an erc20 token it is the wrapped near bridged erc20 that comes in Over the Rainbow Bridge into Aurora but behind the scenes the cross contract call feature is going to bridge that token back unwrap it and turn it into the base near token so that by the time it hits social DB you have just base near so on both sides you're using the preferred token type erc20 and the evm and base near in Social DB and then of course we want this callback back into Aurora to do any error handling we might want to do on this call so that's what the near dot Aurora call does you pass in what address you want to call and any any data you want to pass to it let's take a look at that callback so this this is what it looks like again pretty pretty simple method right Aurora SDK promise result this is getting back the result of the near call that we made and making sure it was successful and if it wasn't we can do some error handling in this case of course I'm just doing a revert message keeping it simple for the sake of the example but you can imagine depending on your use case you might need more sophisticated error handling there so let's move on to another example this is going to be a rust example so this is a contract deployed on Mir which is going to call the uni swap contract which is deployed on Aurora unit swap is an automated Market maker it's a really important piece of the defy infrastructure on ethereum mainnet and on Aurora we've got a number of similar contracts deployed again high level sketch of what this looks like so we have our near contract deployed on near we've got uni swap it lives in the evm and the near contract is going to call in this particular example the exact output single function so this is a sort of low level API in in the uni swap contract but basically it just means I want to perform a swap on one particular token pool and I want a very specific number of tokens to come back from this swap and once again we're going to include a callback so that we can get the results of the evm call back into our near contract to do any error handling or or success handling as well that we might want to do so again what does this code look like well we're still using the same tools just like before we were using standard open Zeppelin tools here we're using the standard near SDK with nearby ingen now you do have to add some extra code that does come from the Aurora SDK Library so what we want to have is full integration with with the near ecosystem typically Json is used to pass in arguments so up at the top we're still taking in those arguments as Json but then we need to re-encode them into the solidity API to be able to pass it into the evm so that's what that big block of code in the middle does it's a lot of lines only because there's a lot of parameters that go into this exact output single function call but it's it's not very very complicated and then at the bottom we actually do the cross contract call so we are again following the same patterns coming out of near SDK right we have the X trait that is able to create this uh thing that that does the the promise uh and actually makes makes the call and we can attach a callback to it and if we take a look at that callback function the again you're actually key patterns are followed we're saying okay the engine gives back its result using borscht so we'll Define that as the serializer and this is in fact a callback but we can still write it in this really nice still Rusty style because of the magic of near SDK that submit result type that you see there is defined in the rust Library coming out of the Aurora contracts SDK and you can see here it has a status field that'll tell you whether the result was successful or not and then if it was we can re-encode it into a lovely Json output for our near users and if it wasn't successful we can make a an error message and that's it that's all I want to tell you for today again the QR code is up on the screen this will take you to that new open source Aurora contracts SDK for you to use and I encourage you to build something cool with it build a cross ecosystem application that has both near and Aurora pieces involved maybe even do it for the East Denver hackathon this weekend thank you all for your attention if you have any questions about any of this please come talk to me I am super happy to talk about this all day long so if you find me at the near Booth later in the day or just walking around feel free to say hi thank you so much","transcript_synced_at":"2026-11-04T03:52:33.163Z","segments":[{"start_seconds":0,"text":"so if I'm a developer and I want to make use of this how do I do it well we've got a brand new open source GitHub","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=0s"},{"start_seconds":9,"text":"repository the Aurora contracts SDK this is a QR code here that'll take you","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=9s"},{"start_seconds":16,"text":"right to that repository this includes a rust library for your near contracts to be able to interact with Aurora and it","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=16s"},{"start_seconds":25,"text":"includes a solidity library for your evm contracts to interact with near so this is covering both sides of that communication","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=25s"},{"start_seconds":33,"text":"and it also includes documentation and examples so that you can get to know this Library figure out how to use them and integrate it into your own projects","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=33s"},{"start_seconds":42,"text":"so let's go ahead and take a look at some of those examples right now so the first example we're going to look at is","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=42s"},{"start_seconds":49,"text":"a solidity example this is a AVM contract that is deployed on Aurora but it's going to call the Social DB","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=49s"},{"start_seconds":57,"text":"deployed on near now social DB is the storage layer that backs the near dot social decentralized social media","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=57s"},{"start_seconds":66,"text":"platform which is a super cool thing in its own right but what we're going to do here is call","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=66s"},{"start_seconds":73,"text":"it from Aurora and that could enable for example a metamask based entry point into the near dot social network and","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=73s"},{"start_seconds":80,"text":"that could could be super cool itself so this is a high level sketch of what the example is doing right so we've got","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=80s"},{"start_seconds":89,"text":"our evm contract deployed on Aurora and it's going to be calling the set function which is uh","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=89s"},{"start_seconds":99,"text":"on the social DB contract deployed on near and we're going to include a callback back","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=99s"},{"start_seconds":107,"text":"to the evm so that we can get the result of that call now the the set method on on social DB","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=107s"},{"start_seconds":114,"text":"is exactly how you store data in in the contract so again you could try to use this for example to try to build a","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=114s"},{"start_seconds":124,"text":"metamask or other ethereum wallet-based entry point into near social so okay so what does this code look like well it looks just like normal solidity","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=124s"},{"start_seconds":133,"text":"code you've got your contract definition you're using an open Zeppelin library and access control which tons of people will be familiar with here and all you","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=133s"},{"start_seconds":141,"text":"have to do is add in the Aurora SDK library for the near related pieces that you want to use","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=141s"},{"start_seconds":148,"text":"so for example this is the definition of that set function call right so we have this nice near dot call","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=148s"},{"start_seconds":157,"text":"command or function method in the SDK you can see it takes the the account that we want to call the method we want","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=157s"},{"start_seconds":166,"text":"to call on it what data we want the near and gas that we need to attach to that call and attaching near is important so","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=166s"},{"start_seconds":174,"text":"that we can cover the storage that we're incurring in the social DB contract but what's super cool about this is the","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=174s"},{"start_seconds":182,"text":"cross contract calls feature is making everything seamless in between these two sides so inside the evm the","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=182s"},{"start_seconds":191,"text":"attached near you're using is an erc20 token it is the wrapped near bridged erc20","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=191s"},{"start_seconds":199,"text":"that comes in Over the Rainbow Bridge into Aurora but behind the scenes the cross contract","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=199s"},{"start_seconds":206,"text":"call feature is going to bridge that token back unwrap it and turn it into the base near token so that by the time","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=206s"},{"start_seconds":213,"text":"it hits social DB you have just base near so on both sides you're using the","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=213s"},{"start_seconds":219,"text":"preferred token type erc20 and the evm and base near in Social DB","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=219s"},{"start_seconds":227,"text":"and then of course we want this callback back into Aurora to do any error handling we might want to do on this call so that's what the near dot Aurora","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=227s"},{"start_seconds":235,"text":"call does you pass in what address you want to call and any any data you want to pass to it let's take a look at that callback so","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=235s"},{"start_seconds":242,"text":"this this is what it looks like again pretty pretty simple method right Aurora SDK promise result this is getting back","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=242s"},{"start_seconds":250,"text":"the result of the near call that we made and making sure it was successful and if it wasn't we can do some error handling in this case of course I'm just","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=250s"},{"start_seconds":258,"text":"doing a revert message keeping it simple for the sake of the example but you can imagine depending on your use case you might need more sophisticated error","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=258s"},{"start_seconds":266,"text":"handling there so let's move on to another example this is going to be a rust example so this is a contract deployed on Mir which","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=266s"},{"start_seconds":275,"text":"is going to call the uni swap contract which is deployed on Aurora unit swap is an automated Market maker it's a really","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=275s"},{"start_seconds":283,"text":"important piece of the defy infrastructure on ethereum mainnet and on Aurora we've got a number of similar","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=283s"},{"start_seconds":290,"text":"contracts deployed again high level sketch of what this looks like so we have our near contract","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=290s"},{"start_seconds":297,"text":"deployed on near we've got uni swap it lives in the evm and the near contract is going to call","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=297s"},{"start_seconds":303,"text":"in this particular example the exact output single function so this is a sort of low level API in in","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=303s"},{"start_seconds":312,"text":"the uni swap contract but basically it just means I want to perform a swap on one particular token pool and I want a very specific number","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=312s"},{"start_seconds":321,"text":"of tokens to come back from this swap and once again we're going to include a callback so that we can get the results of the evm call back into our near","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=321s"},{"start_seconds":330,"text":"contract to do any error handling or or success handling as well that we might want to do so again what does this code look like well","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=330s"},{"start_seconds":338,"text":"we're still using the same tools just like before we were using standard open Zeppelin tools here we're using the standard near SDK with nearby ingen","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=338s"},{"start_seconds":348,"text":"now you do have to add some extra code that does come from the Aurora SDK Library","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=348s"},{"start_seconds":355,"text":"so what we want to have is full integration with with the near ecosystem typically Json is used to pass in arguments","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=355s"},{"start_seconds":362,"text":"so up at the top we're still taking in those arguments as Json but then we need to re-encode them into the solidity API","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=362s"},{"start_seconds":370,"text":"to be able to pass it into the evm so that's what that big block of code in the middle does it's a lot of lines only because there's a lot of parameters that","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=370s"},{"start_seconds":379,"text":"go into this exact output single function call but it's it's not very very complicated and then at the bottom we actually do","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=379s"},{"start_seconds":387,"text":"the cross contract call so we are again following the same patterns coming out of near SDK right we have the X trait","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=387s"},{"start_seconds":395,"text":"that is able to create this uh thing that that does the the promise uh and actually makes makes the call and we can attach a callback to it","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=395s"},{"start_seconds":404,"text":"and if we take a look at that callback function the again you're actually key patterns are followed we're saying okay the engine gives back its result using","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=404s"},{"start_seconds":413,"text":"borscht so we'll Define that as the serializer and this is in fact a callback but we can still write it in this really nice still Rusty style","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=413s"},{"start_seconds":421,"text":"because of the magic of near SDK that submit result type that you see there is defined in the rust Library","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=421s"},{"start_seconds":430,"text":"coming out of the Aurora contracts SDK and you can see here it has a status field that'll tell you whether the","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=430s"},{"start_seconds":437,"text":"result was successful or not and then if it was we can re-encode it into a lovely Json output for our near","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=437s"},{"start_seconds":445,"text":"users and if it wasn't successful we can make a an error message and that's it that's all I want to tell","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=445s"},{"start_seconds":454,"text":"you for today again the QR code is up on the screen this will take you to that new open source Aurora contracts SDK for","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=454s"},{"start_seconds":461,"text":"you to use and I encourage you to build something cool with it build a cross ecosystem application that has both near","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=461s"},{"start_seconds":468,"text":"and Aurora pieces involved maybe even do it for the East Denver hackathon this weekend","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=468s"},{"start_seconds":476,"text":"thank you all for your attention if you have any questions about any of this please come talk to me I am super happy to talk about this all day long so if","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=476s"},{"start_seconds":484,"text":"you find me at the near Booth later in the day or just walking around feel free to say hi thank you so much","url":"https://www.youtube.com/watch?v=jvNB_oogBb8&t=484s"}],"youtube_url":"https://youtube.com/watch?v=jvNB_oogBb8","url":"https://near-pedia.xyz/videos/jvNB_oogBb8"}