Skip to content

Commit

Permalink
offchainUi
Browse files Browse the repository at this point in the history
  • Loading branch information
rchak007 committed Dec 22, 2023
1 parent 144eaef commit ebb279d
Show file tree
Hide file tree
Showing 7 changed files with 1,201 additions and 4 deletions.
Binary file added Images/image-20231222152103913.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/image-20231222152135424.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 89 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@



![image-20231222152135424](Images/image-20231222152135424.png)




![image-20230707152849634](Images/image-20230707152849634.png)



Expand Down Expand Up @@ -168,6 +170,92 @@ To get back the original 23 words.



### OnChain Code

https://github.com/rchak007/plutusAppsJambhala/blob/main/src/Contracts/SeedPhraseManager.hs



#### Datum

```haskell
data SeedPhraseDatum = SeedPhraseDatum
{ encryptedWordsWithIndex :: BuiltinByteString,
ownerPKH :: PubKeyHash
}

unstableMakeIsData ''SeedPhraseDatum

```

#### Parameterized

```haskell
data SeedPhraseParam = SeedPhraseParam
{ pInfoHash :: BuiltinByteString
}
deriving (Haskell.Show)
```



#### Redeemer

```haskell
data SeedPhraseRedeem = Unit ()
```



#### Validator

```haskell
mkRequestValidator :: SeedPhraseParam -> SeedPhraseDatum -> () -> ScriptContext -> Bool
mkRequestValidator sParam dat _ ctx =
traceIfFalse "signedByOwner: Not signed by ownerPKH" signedByOwner
where
txinfo :: TxInfo
txinfo = scriptContextTxInfo ctx

signedByOwner :: Bool
signedByOwner = txSignedBy txinfo $ ownerPKH dat
{-# INLINEABLE mkRequestValidator #-}
```





#### Deploy

To get the .plutus script

https://github.com/rchak007/plutusAppsJambhala/blob/main/src/Deploy.hs





### OffChain Code





















### UI for the Dapp
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Home: NextPage = () => {
}

// for Redirect to offChain.tsx
router.push('/offChain');
router.push('/offChainV2');
}, [walletStore.address])


Expand Down
2 changes: 2 additions & 0 deletions pages/offChain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,9 @@ const offChain: NextPage = () => {
{compPassword} {/* we will re-use this in Redeem so make it a variable */}
<br />
<br />
<div>
{compPersonalInfo} {/* we will re-use this in Redeem so make it a variable */}
</div>
<br />
<br />
<button className="btn btn-primary m-0" onClick={() => { sLockEncryptedSeedPhrase() }} > Lock & Encrypted SeedPhrase</button>
Expand Down
1,107 changes: 1,107 additions & 0 deletions pages/offChainV2.tsx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = {
plugins: [require("daisyui")],
daisyui: {
styled: true,
themes: ['night'],
// themes: ['light'],
// themes: ['night'],
themes: ['light'],
base: true,
utils: true,
logs: true,
Expand Down

0 comments on commit ebb279d

Please sign in to comment.