Workshop: Ethereum Transactions - #3 Event Logs
Ethereum Malaysia·Sat, Oct 9, 2021, 12:00 AM
This is Part 3 in a series of workshops exploring transactions in Ethereum. Other sessions include the following topics: #1 Verifying contracts (watch here: https://www.youtube.com/watch?v=awd5kGPI1fo) #2 Decoding input data (watch here: https://www.youtube.com/watch?v=jkOGavXTuu0) #4 Internal transactions #5 Execution trace Areas covered in this workshop: - Why event logs? - Fields: topic0, topic1, topic2, topic3, data - Walk through how a contract emits events - Compare the difference when it is ‘manipulated’ Slides: https://docs.google.com/presentation/d/1LpY5cKM5qg_rC2dUtckkZfTpdcRoRDCyUdS_SeV57Dc/edit#slide=id.p Prerequisites: - Have watched Parts 1-2: https://www.youtube.com/watch?v=awd5kGPI1fo https://www.youtube.com/watch?v=jkOGavXTuu0
Transcript
thanks everyone for joining us today uh this is part three of a series of workshops on ethereum transactions today we'll be looking at event logs um chichon you can take it away all right thanks hari welcome back everyone i hope everyone is having a great day thank you again for joining me for another week of um ethereum transaction and this is the third part of the workshop and today we're going to talk about logs as harifa mentioned just a quick recap on the previous two workshops and the links are available in uh on youtube in the fkls page so for those who would like to go through it or who have missed it like to rewatch it can just go and subscribe to ekl on youtube and their links aren't there uh quick recap the first workshop we look at deploying contracts and how to verify them on both on sourcify and ether scan the deploying contract parts we have done it on three different platforms which are remix truffle and hardhat these three are the most commonly used platforms and the last workshop we look at uh encoding decoding of methods and its input data we look at how and what the method id is being used for and how is it being generated and how are the input data is being structured and formatted uh there are different ways of um of the of evm handling uh the input data such as bytes and arrays and strings are being handled slightly differently and we also look at them and uh some concepts from the the from workshop number two which is the input data may apply to uh this week's workshop particularly when we uh we will be using a bit of a ketchup 256 as well in this today's workshop so um what are your event logs so this is an example i have let me let me so in the scan when in a transaction page right this is an example of someone someone making calling a transaction and calling a function typically um when they call a function typically uh the functional emit event logs and you can you may find the event logs in this log section in this case there are nine locks being emitted in this transaction itself and let's take a look at particular one and they basically look like this they are in order they are in a synchronous order so this log will be made first followed by the next and next next and let's look at uh the first one right over here like to understand what's in an event log and uh what are the components that are made up in venom so the first part that we are really interested in is the address this address really means um that this contract is being called and the events from are emitted from this contract so um this pool created the sec this pool created event is being emitted by this contract so if we look at this contract we can see that this is a unison v3 uh factory contract so from here we could roughly guess that the person who is calling this truck this this contract has made a transaction to sort of create a pool somehow right and the name the the name section it's not um but not given naturally in in a blockchain is being decoded by the scan uh so to make it things more user readable more user friendly and more readable to humans and note that uh the name in interscape will only be displayed if the escape knows what what how does the this event look like something like how the methods look like in the previous workshop so if you look at this one this one this can not know what does what what is his contract about so that's why everything is not not human readable and hard to read but uh we will go to this transaction at the end of the day and we can sort of roughly know what's going on in this transaction but first let me do it we do it now here first and um and take note that uh so you just get to know that this is this thing this this event being emitted is cool created the contract has to be verified first so this one is verified and we have the api we know the code and that's why the scan knows that this thing is called prograded this one is not verified and hence we do not know essentially we do not know okay so that's how we get the name of the of the uh event locks that is being admitted by this factory contract and moving on we have the topics so there are maximum of four topics uh they have that can be available in uh event logs which are zero one two three in solidity the first topic is the hash of uh this thing uh i'll go i'll go into more detail what i mean by that we look at how to recreate this topic zero but just remember that topic zero is in solidity it's normally reserved for the hash of this event that's being admitted which is book created and it's uh input parameters that leaves us with uh three other topics that we can use because there can only be four topics in in total and the topics are indexed field so as you can see um this token zero right they have a topic one and it's an index topic one so all topics are indexed so we can so basically uh topic one focal zero is actually this one so this is going to be the token zero and this is going to be token one what it means we take a look later uh means it means differently for different uh contract logics they can but you know just just to make people understand hey this is token zero token one and this is going to be the fee and these three are indexed and because we can only have a maximum of four index in total whatever that are not indexed will automatically be included in the data section uh also in the scan uh the data has been decoded nicely for you so it's more human readable originally it would look something like this right and if you recall from last week's workshop uh this thing looks awfully similar to how we decode our input data so the first 32 bytes is going to be the fee sorry the thick the thick spacing because it's not index right the first one in non-indexing so c8 is going to be the stick spacing and the next device is going to be the address right so uh for more uh for more for more info on how to decode this thing you can just refer back to a last week's workshop it's exactly the same as how how is decoded right over here same how same same thing goes to how string arrays and bytes are being decoded formats is the same and all right um now that we have looked into event logs so the next thing is to do is to understand what's the motivation behind emitting an event log so because when a function is being called by the user uh basically when we if we were to return expect a return value the blockchain cannot return a return value it's not this unlike our it's unlike our typical uh function calls in maybe our other programming languages we can expect a written value being written in this case let's say if you want to know the pool address and we call this function right um there's no other way there's no way over here that tells it the address of this is being created so the other way to do it is to emit the result in an event log so that people can come back to this transaction and say that hey look um this transaction has created this full address so a way to track the return value that's motivation number one number two is that from the event logs that are being locked over here we can roughly understand what's going on in this transaction so this one is procreated and the next one the next one string transfer approval we can know what this transaction is trying to do in general now there's a huge caveat because unison v3 is a very trusted project and everything's open-source we can easily trust that the naming of this pool is is correct to its uh to its behavior because anyone can name this thing as anything it could be maybe uh maybe pool destroyed for example and then yeah i made this one and then we we would have thought that this pool is being destroyed but the the the programmer decided to just you know try to play tricks with us so just be careful and not to trust the name of this event hundred percent always uh look at the code look in the documentation to understand the purpose and what is being emitted by each function it means i'm sorry by each event and so we can track it we can know what's going on which we will look at later and the last one is something that i would always use uh depths and uh people who like to index the data in a blockchain can easily subscribe to an event to sort of track the event that is being admitted meaning if i for example in my case let's say i want to bring a project that has all the posts in unison v3 so the easiest way for me to do is that i i track it by topic zero this topic zero specifically and i know because i know that the contract this thing is a unique unison pg factory so i track it by this address and this topic zero and whatever that returns over here it's gonna be my pull uh my unison which is full so i just track it and and then and then i store this pool somewhere maybe in an off-chain db and i will have all collections of uh of unison v3 pools and there are a lot of use cases for this uh it really depends on on the depth itself but yeah event locks enable depths to track the events that have been emitted and maybe they can index stuff store stuff uh off-chain so that you know they don't have to keep quarrying the the note which may be slow uh yeah so that that's those are the three i think main motivations that um [Music] that um people would uh would use event logs all right uh moving on let's look at okay okay let's look at uh topic zeros and uh how the other topics are being generated all right ross i'm going to answer your question right this section so topic zero basically means uh hang on this means the insanity right i have to i have to mention that in solidity because it may be different from in other and other languages insularity basically means the capture hash of this this function name along with its parameter so let's take a look at our trustee can check two classes online calculator and let's try to prove that the catcher of this thing is indeed this topic zero right so let's try to do that so the first thing i'm going to do is i'm just going to copy this similarly to how i did in uh in my method id i'm just going to copy this and this thing is not going to match yet because i have to remove all the parameters name and along with all the spaces like these static spacings everything will remove it spacers can remove it and just spare me for a bit uh this thing i'm also going to remove it uh no wait did i remove something wrong yep yes token one remove this [Music] and this index thing is going to remove this one as well this one so once i remove every of the names and spacings i'm just leaving behind the event names bracket and the parameters type along with the commas i will get this one this is the hash of this function i mean this event and this hash basically will be equivalent will be exactly the same as uh zero right so seven eight three and with one one eight so it's gonna be seven eight three and we wanna wait so it's gonna be exact same so that's how topic zero is being generated by solidity and and um next topic one two and three because they are basically index field so it depends on the the parameter types that we are putting into so in this case um the first field over here is an address right so topic zero is going to be an address so this is the original form so for address we know from our previous workshop that um [Music] that um the address we only have to take the last 20 bytes so it's this is lastly right starts from be so this is it's going to be the address and you in is just uh convert this to uh decimals so and so forth so the the process is similar to how we do it in a method id as for the data as mentioned before it's exactly the same as how how we do it in last week's method workshop so i just split this by 32 bytes and 32 bytes and then the first one will be the first layer that comes which is uh the first non-index parameter which is the tick spacing the second will be the pull so this one is going to be the pool address and this one is going to be a tick spacing right so yeah it's we can if we know what's coming in the parameter uh we can decode this thing easily all right uh question time uh any reason why only four topics well because the topics are indexed right so if we were to index more topics you'll be very very heavy to store because index basically takes a bit more resources in a in a node's database so i think that's why they they created i i'm not sure how they how they calculate what what what's the optimum number of topics but they came out with a four and the first one in solidity is always used for the um the catcher hash of the event names and the parameters so i don't know why only four but more will definitely be more expensive to store uh by the node yeah we don't really need not in it for mining we just need it for that's a lot so yeah uh right so any more questions i think ross i think i answered your question i'm okay i think we can move on all right cool uh [Music] next okay so this is a remix code that i i wrote so let's take a look at it so to include events in our solidity we have to declare events over here by putting the events keyword followed by the name of the event and the parameters that we're interested in and also if you want to index the field we have to include this keyword index in front of the parameter name and then this one these two will be the index i mean sorry these two will be the parameters what am i talking about these two will be the events that we are declaring in solidity contract and to emit those events we have to include the emit keyword in front and the event name as along with the variables the parameters that you're interested in and this one will be emitted right so this is just a recreation of that and an example of how an example it's this one over here so i made an infant and these three are index topics and these three are the non-index topics which are exactly like this okay i purposely put string as the index topic because string has a different behavior [Music] in it when it's indexed so we notice that this thing is definitely not definitely not our usual string format right because we know that a string has uh we declare the offset and the length and followed by the number of the the string in in the ending but this is not so what is going on over here now because topic zero it's only i only have a 32 bytes so this thing over here is our actual string value and we could check can check 256 hash it and to store it here so in other words uh it's there's not much motivation maybe maybe there there are some use in it but stirring putting strings as an index in a topic a way there's no way to sort of know what is behind what what is the actual value of this tree what i did over here is that i i love this i love the exact same string here and here in a topic and a so when i try to check this let's make sure here i will this i can prove to you that um this value uh 471 and fad uh matches with uh just with this one four seven one fad right so so yeah uh be careful that be careful when indexing string because uh the string value the original hello value will not appear here but it will be hash and because contract is a one-way function that is almost no way for you to know that this is hello world unless i unless i tell you so in this case i tell you here yeah so just be careful when dealing with strings and bytes in general uh all right so so yeah this is uh basically how this and how to emit it in solidity code now let's look at how to um [Music] how to get the event logs from a from a node we can simply get the event logs by calling making a json rpc call to the node so i have postman open over here um this is an infura and uh this is the project id uh which is actually matamas uh insurer uh link url i just copied over so i'm okay to share with everyone and this is a structure of uh how do you call one node by calling the uh jsonpc so we have the j72.0 and the method is going to be if underscore get locks so that we are we are essentially trying to get the nodes and the id is the id is not important here but we have to put it as a some number uh the parameters are what we are really interested in so what i'm trying to do over here is that i am trying to query for topic zero that has this one and topic one that has this one from this block by the address of this so if i were to query it oh i mean okay yeah got it if i were to query it i can see the event logs that are that is being emitted in from this block onwards and that has topic zero displays so that's that's what i mean by index because because these two fields are indexed right we can easily query them because database starting is making things easier to find if the values are being indexed so if we were to go to this one over here let's go into scan and i actually index for this field right so i'm actually uh trying to search for this this event uh from my uh json of course this is just an example right you can uh play around with uh your analog stack that you want and by querying uh using this method the jsrpc method and then and one thing to share is the [Music] uh get locked uh documentation this inspired infura [Music] so these are the parameters that they have so you can you can buy you can filter by address from which block to which block the topics as long as with the block hash so yeah it's similar to how i i did it over here i have the address sorry wrong one i have the address i have from which block uh remember to put in hexadecimals because if you put it in numbers it would not work you have to convert to hexadecimals along with the topic zero and topic one so if you want to call it only for topic zero you just remove this or you only want to query for the topic one you you put it as uh this now oh now without without the open and close okay this and so and so forth so if you want to uh query for maybe uh topic one and topic three you have to put it like this maybe let's let's assume that topic three is going to be the same thing it's gonna be like this okay so this is how you play around with the indexing so and the last part will be talk about this talk about this last part is is to it's just a lot of caution right um because anyone essentially can recreate this in this this event uh this is not a good answer anyone can basically we create this event uh this is topic zero so if we were to only subscribe for this topic zero anyone can uh can mess up with our indexers if we try to track track uh travis event so it's important for us to also take note of the address that that that emits this event so for example if i want all uh to get the address of all usb3 i have to query by this log topic zero also with the address because if i don't anyone may deploy another contract with the same topic zero with the same outcome to mess up with our indexer so for example i have a con i have a remix code over here i'll notice that uh there's also a pool created here right and everything over here matches with uh with the parameters here so basically i'm trying to recreate another topic zero pro created event which um which i did it's right here so if we were to rely only on the on the topic zero this random contract right we'll throw up some random pool created address to mess up with our indexer so this one will be invalid that is invalid pool so our data will not be accurate so yeah this is something to take note do not own if you would like things to be more specific do not take the topic zero only filter it also by the address and if you if this this topic zero is emitted by a variety of addresses this query by the variety addresses just just make sure that the the the events that are emitted is from the address that that you really want right this is a a bit of a word of caution uh okay so we've basically talked about most of the event logs related subject so any questions before i move on and try to demo what's going on in a in a in the in transaction the use of v3 transaction that i that i um [Music] that i showed just now um how do you approach thinking about what events you want to emit for your contract basically for each method right because for each method i would like to let the user know what method is doing so for example in this pool created for example this one right clicking so for example when the user is calling i sort of can expect that what people want it's the pool address and i will create a i'll put it meaningful names that is procreated make people know understand this thing easily so i want you to confuse them by putting some confusing names so basically each method emits one event that is meaningful to what is happening to them to the method that's the i would say a rule of thumb of course there are other outliers i i don't know why people want to do that um yeah so i i would guess that uh people might might find this information to pull this information useful and so i admit it because i think i'm guessing as a developer or i have talked to a several parties that might use my data that this structure is something that people might want so that's it are there are there any drawbacks for like creating too many emitting too many events uh basically there is a small gas fee involved in emitting an event but it is it's it's it's uh it's it's not to say it's it's cheap right but there are guest fees being involved so too many unnecessary events may actually be a bit expensive when you try to call it methods i think that's the only thing i'm trying to there that i that i can think of and and maybe if you're a smart contract creator and you don't want to be transparent uh for some reason you want to be more uh obscure about what your contract is doing then you wouldn't want to admit yes even right yeah then you wouldn't want to admit events or you wouldn't even verify the contracts yeah because uh from the topic zero alone right i'm not sure like was going on here like i want to know what the name of this topic so i wouldn't emit an event or i wouldn't uh verify my contract yeah so i guess that's that's what that's that's what i would do if i don't want people to know what's going on okay thanks awesome uh right shall we move on to uh understanding this transaction okay uh wait there's a new message that was used to create a pool um yes yeah so let's let's look let's look into this uh so okay uh so we know that uh the events are being emitted synchronously right so this one met first and so on so and so forth so yeah we can probably know what's going on in this transaction so from the first event lock this pool is being created and to answer first question what two tokens are being used because uh it's gonna be token zero and token one so these two are the uh tokens the actually tokens that are involved in uh in the creation of this pool so it's going to be this uh token token and a web a common use token that people use to create a pair for so in this case uh user v3 content has kindly included all this information for us so we can know from a glance that hey this pool is being created and these two are the tokens they involve and the tick spacing is this one for those who want to know sorry the fee is this one for us who would like to know more or what type of fees and so on and so forth and moving on let's okay so after the pool is created what happened over here there is this random thing random topic zero so basically we have no way to find out uh but we actually do because usual v3 is an open source contract rate so let's look at what is what is what is this contract about this thing it's uh this thing is actually the pool fc68 so it says this is fc68 this is good xb68 so this this event is being emitted by the pool now uh from from my from my study uh the unisa pose will emit this is from documentation the the events that will be emitted by the usables are basically this this initialized main collect burn swap flash so and so forth and then what i would do what i what i did was that i look at the topic series and the topics and the data so basically i don't have any index um index values i only have a data so i will go and look for maybe maybe a design with only two two parameters so maybe uh okay initialize may look like one uh mean it's definitely not because there's so many parameters collect it's also not burn nope swap no flash no uh this one maybe but you know we are using our smart guess that this is a negative number so this is u in so it's not uh it's definitely not and it's definite so let's leave that leaves us with only initialize so this public zero is actually the initialized event and to ensure that it's really initially the initialized event let's let's use our cad check 256 online again to to make sure that the topic zero matches so i'm just going to copy this one over here oh no i don't need an event keyword okay and make sure everything is correct and uh it starts from 9863 as we have c95 so we just go back let's start with 9863 yep ngc nine five so yeah indeed this thing is this this uh this topic is indeed the initialized event and from the documentation because the only way we can know is it is that we know in advance right what are the values the first one will be square root price of x 96 and the second will be the ticks so this one will be uh if you convert to decimal number [Music] yeah it's uh the square root price is going to be this huge number and this one we correct number it's going to be uh well it won't work because this is a an integer so we need to use the two complement to find out the ticks it's probably going to be a negative number so there's a two components calculator we can use but i'm not gonna do that now just then just know that this is a maybe a negative number because ticks can be a negative opposite number so after the two is created it's initialized with um these two values and the next one is a transfer event so let's look at uh what is being transferred so eskimo uh erc20 token has been transferred from this address to fc69 which is the poll that's been created okay we're transferring uh one one of the token pair into the amount into the pool and what's going on here uh be7 so after that it has an approval um event locks i i don't know why it emits a pro after we transfer it uh next is the deposit event log and this is the the web uh ref control address right between contract address and if we look at the deposit event we can see that this deposit here it's from the measure sender and return to the value so what this does is that it uh wraps your ether to to weft and this is the return value and then it transfers from [Music] left to the pool sorry no this one oh sorry wrong one it transfer the weft to the pool that we just created the full value this one this one and then over here another unknown um [Music] another unknown event log so we know that this is the pool so we just revisit our our pool documentation to guess what was it what's this so we can see that there are one two three four five six seven eight eight parameters uh this is definitely not one two three four three four five six seven this is not is it sorry one two three four times seven yeah this one's like sorry seven so this is seven it could be this one uh definitely not this one one two three four five six no swap one two three four five seven oh yeah could be this one so it could be min or swap but let's look at the yeah it's a yeah it could be one of these two it could be no it could not be flash definitely not this this and not this so over here we repeat the process we repeat the contract two five six process to to guess to knowledge i guess to identify what event is being called here i i know it is already it's mint because it cannot be swapped right because we are creating a new pool but i'm gonna show it just to just show that it's correct okay seven a five three this is so seven eight five three yeah so this is indeed the min uh event and uh once we know this we can accordingly decode the parameters so this so yeah and then transfer again so uh what this this event is doing is that the nft position is minting a new nft token with token id of 42777 to this guy so after you have uh after the main function is called this this this uh nft manager contract will mim and token nft token for the user six to a two eight nine right so because you need some v3 every position is represented by nft in the in this contract okay by this position nft at the end of day uh this nft manager will emit another event is called increased liquidity and it and it updates the uh the nft position of this user and these are the the the values that has been updated it's liquidity that has been increased the amount zero amount one that a user has put in and the token id so from this transaction we know that a pool is being created uh funds are being tokens are being transferred to the pool right until here uh the nft is being minted and the liquidity of the user has been increased so so roughly we know that these are things that's happening from this transaction all right so that's probably uh that sums up the exp the the thing uh let me look let me look for iman's exam oh there's so many questions i have which i didn't read so before moving on to elma's example let me try to see if there's any questions uh the guess is writer while events emitted or by the color oh it's better color alex it's better color for unison v3 can you also click on the pool and see the balance help uh do you mean you mean that you're trying or hurry do you mean that you're trying to know how much the nft is owning the token or just the liquidity uh no i was just saying you can click on the pool address and you can see the total uh balance of each token uh held there oh yeah uh yes you're right uh because you need user v3s ui has already calculated for you but if we were to query this manually on the blockchain right we wouldn't be able to see how much of what token makes up the liquidity we have to use this liquidity and apply some some maybe mathematical formula it also depends on the current price of the pool and apply the respective formula and then you can get the proportion of token one and token zero in uh that you that you you currently your position currently has yeah so it's a bit tricky the mess but it's stuck it's still both [Music] unison v3 represents okay i'm sorry for answering that uh cool all right i think that sums up all the questions for that so now it looks like let's look at iman's transaction i've not looked at this so it may not end up well but let's try okay uh from here i know that it's a thermal okay no i shouldn't look at the uh i should look at the transaction action because it's a it's basically a cheating way to understand it uh first thing i'll do is i look at the input data and the quantity i mean i'm guessing that it's minting two two nfts so the only two event logs oh yeah because for uh foreign the standard is to is to emit event logs that have that that is name of transfer and there's a token id so from here right right away i know that uh this token id is being admitted to this user so in this case two of these are being edited so the id is two four five one and two four five two respectively yeah uh straight forward because they have to follow a certain standard for nft so they are following standards and uh and yeah this is uh what is expected so to double double confirm we have the function mean right yeah there you go this is the function min this method is being called and how many empties that do you want must be at least one and blah blah blah blah uh the mean is it's probably called here so let's try to search that here and this one uh pressure they're using some library to uh to min the nfp and the library has the transfer event log included in it so by using the library this thing is automatically uh generated for you without the programmer having to emit it manually because the library has done it for you so yeah that's all any questions for this transaction i'm on valid satisfied satisfactory [Music] one question is why are some of the emitted events shown on each scan well others you have to dig it up uh what what do you mean harish so if you look here for example you can see that the name is transfer whereas in uh a couple of the previous transactions you looked at uh some of the names uh of the events uh are not uh available ah okay uh it's not to say they're not available because this thing is calling a library right and i let me look at the i think it's calling this library so so if we let's look at it's there it's there it's just that uh that is here it's just that it's calling another function in another contract so over here it's calling this function right over here you can see admit transfer so it's there it's just that it's in another uh another part of the quota so to say it's because it's a library that everyone uses so so we can just include this library into it and just call it spin function and and this one follows the standard right this erc is seven two one follows yes one standard and so emit transfer is automatically included in the code yeah i mean each one if you look at your previous unison v3 transaction where we looked at for example initialize and the name wasn't shown on etascan we had to look at the documentation to figure out oh you mean this one uh the reason being is that this pool this unison v3 pool for some reason it's not being verified so we do not know um we do not know the api and hence we do not we cannot decode this uh accurately and therefore uh we have to leave it in uh in this manner and because this we use v3 sorry harif because this user v3 we can trust that the contract they're deployed it's it's exactly as they said we can trust and then therefore we can dig up the document to try to match the events that looks like this or we can also look at the code that deployed on github but i chose to look at the documentation because it's easier for me no but uh you can see the other functions names are shown on each scan while some of the events don't have their names shown um you mean this one and this one right yeah yeah because this thing is not being verified because this contract is not verified this contract is contract so it's not verified so look we do not know the api okay does that answer the question yes i do not know what this why is this not being verified uh maybe there's no way to do it automatically for now but i heard that unicef retreat is trying to get all the pool contracts refined on each scan i'm not i'm not sure how they're gonna do it but some of the post has already been verified like i think the uni rev pool has been verified and some for example this for example this one uh e e e akt is not not a very famous pool to be honest and uh it's not very fine maybe maybe those favorite pools if famous posts are being done manually i'm guessing yeah his point so yeah uh to to elaborate because this transaction is actually calling a function that delegate calls to uh and the calls to other other contracts for example this contract is being called this contract being called so we can see that the events that are being emitted are from different contracts like so happen this contract is from i mean this event is from a contract that's unverified this one is from a contract that's being verified because this is an erc token token and the standard is always the same yeah so we we know that the transfer is going to look like this yep i think if uh no more questions we are uh five minutes to 5 p.m uh if anyone has any final transactions that uh you'd want uh us oh okay that's another one all right let's copy i'm gonna close the rest all right nah just wanna just gonna leave it at this let's see what's oh what am i doing i should just do this all right this thing is similar right to the one that uh that we talked about earlier yeah it's a similar it's exactly the same uh no i think you you copied the wrong link oh sorry uh okay uh why does it have one shot shown in this game but there are two socks in the lock what do you mean one swap into scan uh soft hazard so it looks like the use of v2 yeah you mean you may hear transition action let's see this one to this one for this one so yeah you're wondering how come there are two of these right uh bye uh short can you guys hear me right yes yes um so that's my question so in the transition there is a swap shown but if you take a look in the logs itself there are two swap action edited so i'm curious why if the scan is showing just one of them uh you mean one of the swaps one of the shops i mean there are two swap events yeah i can see it uh here and here right okay so you're wondering why the how come yeah what do you want the transaction exchange uh let me try let me try to understand what's going on over here uh i'm not sure if this thing has been combined into one one one action um but but like like what uh highway has said right um this thing is a it's a multi has multiple hops it doesn't go to this one directly is from usd to left and right to this other token so it has its own effect have done two stops for you so over here has two swaps so uh that is understandable and over here i am not sure but i'm guessing that uh the developer for this part has already combined everything for you so that they are not showing the hops that we which may be confusing uh we can look through the locks yeah okay uh transfer i think this is 20 token okay so usdt is being transferred from this guy to this guy uh this is the value that's been transferred to three four five six two hundred eighty total eighty three dollars okay uh it's been transferred to the pool and this pool uh transfer this is from ref right source uh destination let's see look investigation okay so this pool the usd the the unisock pool uh transfer weft to this uh this this task uh task unity software okay and next six okay sing is just updating the liquidity we don't have to know a shot all right this is the shock that we're interested in right uh okay so swap will tell us that the sender which is right let me let me let me double check the sender i don't remember the sender okay the router and index two is two this guy uh let me let me okay this is tas and this is which is again okay [Music] yeah it's hard to do it because i don't really uh i'm not really familiar with the user v2 uh soft thing but effectively it's trying to is using router under the router it's um no no no sorry oh yes the router it's uh swapping from this thing to this thing so this is the the hops are that we are trying to we're trying to um we are talking about on the hops because we are not directly trans because that probably there isn't there are no usd to passport so you so unisop e2 has with the help of the router has changed everything to web and from ref change everything to task and return the task view so this is one of the hotter the weft to the past so after that after after we have done that what's this i don't remember oh this is uh this is the task token okay the task token then transfer from this guy to this guy who's this guy uh this is something familiar i don't remember oh okay uh yes it's just uh you're getting you are getting the uh this amount this guy's getting this amount uh yes this guy is the contractor okay this guy's okay this guy's getting this amount and this is not important and [Music] what is this too many and i don't remember all these little things okay router again and okay hey hey no no wait hang on [Music] i confused myself uh d3 okay d3 from [Music] this this one seven eight sorry sorry let me try again this router and this is and this is with b4 okay e3 just before it i can use this okay use this key usdc uh but it's swapping right so in it's this out like this so this one returns you sorry this one returns you the in uh i actually forgot what that's all this stands for uh but one of them is means that you're putting the token in and this one returns you the token so this thing is done by this and this pair let me double check [Music] yep this thing is done by the task webpack and this thing is done by the usdt [Music] web pair right so effectively you are putting usdt in i may be wrong because um i i i didn't look at the annoying amount uh carefully but effectively you're putting in usdtc usdc and then you're getting tasks but it's being it has two swaps because it has two it involves two uh different pools so you swap v2 router has already uh sort of done it automatically for you without having the usdc to task direct pair and back to the question of why there's only one i believe it's the transaction actually is showing only one swap yes uh because i think it has been aggregated for you so because uh i think i'm not sure what's the direction behind because i i think it may be confusing for users to show like this this is sometimes there may be like a lot of hops that may be confusing so i think i'm not sure how rich may even correct me yeah i'll clarify this part it's a lot easier um so the transaction action is just a section that just summarizes what's actually happening for the end user uh so we skip a lot of the details and and we just show you what the end user really wants to know which is uh they gave usdc um for ether um what actually happens in the back end we don't show if you want to know you can look at the tokens transfer and you can look through the event logs but for the the end user a lot of the the the average end user they just want to know what's happened so transaction action shows that detail yeah because i remember that was before that there are like a lot of a lot of things are going on over here that sometimes it's very hard to read right so i think you guys decided to make a change uh yeah so it's more like a user experience kind of thing hope that answers your question uh all right no problem thanks sorry for the help assist i i guess i i'm not involved in this i don't know what's going on over here uh all right any more questions okay it doesn't seem like we have a question okay so uh that should be it um so thanks everyone if you have any further questions later on i can feel free to drop it in telegram or discord and we can take a look at as well but uh as mentioned i think a while back because i think someone asked this question in telegram uh so it takes time to go through the event logs and figure out what's going on especially if it's not a common uh commonly used uh contract uh like in this case unison v2 or v3 so whoever it is that's looking needs to like go through one by one and and see which contracts are called and so on so it's not uh something that that can be done uh just like that so ideally uh yes i mean i remember that was you so ideally like um now that there's a bunch of other people who've uh seen this next time someone has this issue we can kind of have more hands to look into it instead of just one or two people yeah so so that's one of the goals of having these workshops and yeah so thanks everyone for joining thanks a lot chi chuan for sharing thank you everyone thank you harish
Automatic transcript — names and jargon may be misspelled.