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

Datum #83

Closed
Tracked by #85
aleeusgr opened this issue May 5, 2023 · 2 comments
Closed
Tracked by #85

Datum #83

aleeusgr opened this issue May 5, 2023 · 2 comments

Comments

@aleeusgr
Copy link
Owner

aleeusgr commented May 5, 2023

Each UTxO locked at a script address will also have an associated datum. The script can choose to use the datum as part of the spending validation, or it can choose to ignore the datum if it is irrelevant.

@aleeusgr aleeusgr mentioned this issue May 5, 2023
Closed
6 tasks
@aleeusgr
Copy link
Owner Author

aleeusgr commented May 5, 2023

               // This represents the Datum struct from the Helios on-chain code
 73                 // loan:          
 74                 struct Datum {   
 75                     ?lender: PubKeyHash   
 76                     ?borrower: PubKeyHash   
 77                     collateral: policy id   
 78                     deadline:    
 79                 }                 
 80                                   
 81                 // vesting:      
 82                 struct Datum {    
 83                     creator: PubKeyHash   
 84                     beneficiary: PubKeyHash   
 85                     deadline: Time   
 86                 }                  
 87                                    
 88                 // my datum now is for matching_keyhash!!!
 89                 struct Datum {    
 90                     owner: PubKeyHash   
 91                 }   

@aleeusgr aleeusgr mentioned this issue May 6, 2023
2 tasks
@aleeusgr
Copy link
Owner Author

aleeusgr commented May 9, 2023

struct Datum {    
 83                     creator: PubKeyHash   
 84                     beneficiary: PubKeyHash   
 85                     deadline: Time   
 86                 }        
const datum = new ListData([new ByteArrayData(ownerPkh.bytes),
                              new ByteArrayData(benPkh.bytes),
                              new IntData(BigInt(deadline.getTime()))]);

const inlineDatum = Datum.inline(datum);

@aleeusgr aleeusgr mentioned this issue May 11, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant