Skip to content

Commit

Permalink
feat: added coupon bon, catalyst and fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglescode committed May 5, 2024
1 parent 7266f7e commit 3c1a88e
Show file tree
Hide file tree
Showing 27 changed files with 1,304 additions and 1,093 deletions.
Empty file.
3 changes: 3 additions & 0 deletions packages/contracts/src/coupon-bond-guaranteed/offchain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { MeshTxInitiator } from '@mesh/common';

export class MeshCouponBondContract extends MeshTxInitiator {}
3 changes: 3 additions & 0 deletions packages/contracts/src/coupon-bond-guaranteed/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Coupon Bond Guaranteed

Debt agreement between an "Lender" and an "Borrower". "Lender" will advance the "Principal" amount at the beginning of the contract, and the "Borrower" will pay back "Interest instalment" every 30 slots and the "Principal" amount by the end of 3 instalments. The debt is backed by a collateral provided by the "Guarantor" which will be refunded as long as the "Borrower" pays back on time.
198 changes: 198 additions & 0 deletions packages/demo/components/pages/about/catalyst.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
import Link from 'next/link';

export default function Catalyst() {
return (
<>
<section className="bg-white dark:bg-gray-900">
<div className="py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6">
<div className="px-4 mx-auto mb-8 text-left md:mb-16 lg:px-0">
<h2 className="mb-4 text-3xl tracking-tight font-extrabold text-gray-900 md:text-4xl dark:text-white">
Catalyst
</h2>
<p className="font-light text-gray-500 sm:text-xl dark:text-gray-400 mb-4">
Here are proposals that we have submitted to Project Catalyst and
its progress.
</p>
<div className="grid grid-cols-3 gap-2 w-full">
<ListOfProposals />
</div>
</div>
</div>
</section>
</>
);
}

function ListOfProposals() {
return (
<>
<CardLink
title="Mesh x Defy x Yaci: Private Blockchain Networks for enabling real world financial services and Cardano Adoption (F12)"
desc="?"
url=""
completed={[]}
tobecompleted={[
`Design, setup and deploy Yaci cloud infrastructure`,
`Mesh upgrades to support transaction building and wallets integration on Yaci`,
`An identity solution, smart contracts that define regulators requirements to support users' identity and KYC records.`,
`A KYC solution, smart contracts that define regulators requirements to support KYC processes.`,
`A KYC verification solution, smart contracts that define how users' records are verified which results in reputation scores and incentivization mechanism.`,
`Whitepaper about private network and KYC use case`,
]}
/>

<CardLink
title="zkFold x Defy: Derisking cross-border payments with Zero-Knowledge Proofs (F12)"
desc="?"
url=""
completed={[]}
tobecompleted={['?', '?', '?', '?']}
/>

<CardLink
title="Mesh New Features to Improve Developer experience and Cardano Adoption (F12)"
desc="?"
url=""
completed={[]}
tobecompleted={[
'CIP 45',
'Mesh application wallet',
'Modular CSL library',
'Improve error messages',
'Wallet support for private blockchain networks (Yaci)',
]}
/>

<CardLink
title="Mesh Software as a Service (F12)"
desc="?"
url=""
completed={[]}
tobecompleted={[
'Cloud infrastructure and transaction endpoints',
'Upgrade Mesh SDK to support SaaS',
'Hosted wallet / private key for signing',
'User-defined transaction building',
'JSON schema for transaction',
]}
/>

<CardLink
title="Mesh - Advance Cardano SDK in Rust (F12)"
desc="?"
url=""
completed={[]}
tobecompleted={['?', '?', '?', '?']}
/>

<CardLink
title="Aiken Open-Source Smart Contract Library (F11)"
desc="We create a collection of open-source smart contracts with Aiken (including Workspace, Mesh TX builder components) and integrate them into the Mesh SDK library on Github - open and accessible to all. "
url="https://projectcatalyst.io/funds/11/cardano-open-developers/aiken-open-source-smart-contract-library-by-meshjs-and-trustlevel"
completed={[
'Marketplace contract',
'Escrow contract',
'Vesting contract',
'Gift card contract',
'Coupon bond guaranteed contract',
]}
tobecompleted={[
'Content ownership contract',
'Advanced contract #2',
'Advanced contract #3',
'Bad examples',
]}
/>
<CardLink
title="Sustain & Maintain MeshJS (F11)"
desc="This proposal enables implementations not limited to Voltaire features, Hydra & Aiken integration, and data providers integrations. Including bounties for issues, features, and learning materials."
url="https://projectcatalyst.io/funds/11/cardano-open-developers/sustain-and-maintain-meshjs"
completed={[
'Lower-level APIs completed',
'Technical documentation released',
'Resolved numerous reported GitHub issues',
'Active Discord and social to help developers',
]}
tobecompleted={[
'Plutus version 3 integration',
'Revamped/refactored transaction and utilities class',
'Conway features',
]}
/>

<CardLink
title="Supporting Open-Source Library Development, Developer Resources & Builder Community (F10)"
desc="To guarantee and ensure sustainability of a team dedicated to maintaining and developing one of the best open-source libraries on Cardano, providing devs with something easy-to-use, fun and productive."
url="https://projectcatalyst.io/funds/10/f10-osde-open-source-dev-ecosystem/meshjs-sdk-operations-supporting-open-source-library-development-developer-resources-and-builder-community"
completed={[
'Lower-level APIs core functionality',
'Mesh PBL course content',
'Workshops and live coding',
'Community Q&A support',
]}
tobecompleted={['Mesh PBL Season #1']}
/>
</>
);
}

function CardLink({ title, desc, url, completed, tobecompleted }) {
return (
<div className="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700">
<h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
{title}
</h5>
<p className="font-normal text-gray-700 dark:text-gray-400">{desc}</p>
<ul className="mt-4 text-sm text-gray-500 dark:text-gray-300">
{completed.map((item, index) => (
<li key={index} className="flex">
<div className="h-4 w-4 mr-2">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-4 w-4 text-green-500"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M5 13l4 4L19 7"
/>
</svg>
</div>
<span>{item}</span>
</li>
))}
</ul>
<ul className="mt-4 text-sm text-gray-500 dark:text-gray-300">
{tobecompleted.map((item, index) => (
<li key={index} className="flex">
<div className="h-4 w-4 mr-2">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-4 w-4 text-gray-500"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<circle cx="12" cy="12" r="10" />
</svg>
</div>
<span>{item}</span>
</li>
))}
</ul>
{url && (
<div className="mt-4 text-sm text-gray-500 dark:text-gray-300">
<Link href={url}>
<span className="text-blue-500 hover:text-blue-700">
projectcatalyst.io
</span>
</Link>
</div>
)}
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export default function Hero() {
<div className="p-2 mr-4">
<ArrowsRightLeftIcon className="w-16 h-16" />
</div>
<span>Swap</span>
<span>Coupon Bond Guaranteed</span>
</div>
</h2>
<p className="mb-8 font-light text-gray-500 sm:text-xl dark:text-gray-400">
Swap contract
contract
</p>
</header>
<div className="grid grid-cols-1 px-4 lg:grid-cols-3 lg:gap-4 pb-16">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Hero from './hero';
// import VestingDepositFund from './depositFund';
// import VestingWithdrawFund from './withdrawFund';

export default function ContractsSwap() {
export default function ContractsCouponBondGuaranteed() {
const sidebarItems = [
// { label: 'Deposit Fund', to: 'depositFund' },
// { label: 'Withdraw Fund', to: 'withdrawFund' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ function Left() {
A user can cancel an escrow if the other party fails to fulfill the
terms of the agreement. Cancel can be initiated by any users who have
partcipated in the escrow and can be done at any time before complete.
Canceling the escrow will return the assets to the respective users.
</p>
<p>
This function, `cancelEscrow()`, is used to cancel an escrow. The
<code>cancelEscrow()</code> cancel an escrow. The
function accepts the following parameters:
</p>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Left() {
completion can be initiated by any recipient of the escrow.
</p>
<p>
This function, `completeEscrow()`, is used to complete an escrow. The
<code>completeEscrow()</code> complete an escrow. The
function accepts the following parameters:
</p>
<ul>
Expand Down
17 changes: 10 additions & 7 deletions packages/demo/components/pages/contracts/escrow/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export default function Hero() {
code += `\n`;
code += `const { connected, wallet } = useWallet();\n`;
code += `\n`;
code += `const blockchainProvider = new BlockfrostProvider(\n`;
code += ` process.env.NEXT_PUBLIC_BLOCKFROST_API_KEY_PREPROD!\n`;
code += `);\n`;
code += `const blockchainProvider = new BlockfrostProvider(APIKEY);\n`;
code += `\n`;
code += `const meshTxBuilder = new MeshTxBuilder({\n`;
code += ` fetcher: blockchainProvider,\n`;
Expand Down Expand Up @@ -45,14 +43,19 @@ export default function Hero() {
</header>
<div className="grid grid-cols-1 px-4 lg:grid-cols-3 lg:gap-4 pb-16">
<div className="col-span-2">
<p>
The escrow smart contract allows two parties to exchange assets
securely. The contract holds the assets until both parties agree and
sign off on the transaction.
</p>
<p>
There are 4 actions available to interact with this smart contract:
</p>
<ul>
<li>initiate escrow</li>
<li>deposit</li>
<li>complete</li>
<li>cancel</li>
<li>initiate escrow and deposit assets</li>
<li>deposit assets</li>
<li>complete escrow</li>
<li>cancel escrow</li>
</ul>
<p>
To initialize the escrow, we need to initialize a{' '}
Expand Down
4 changes: 2 additions & 2 deletions packages/demo/components/pages/contracts/escrow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import EscrowDeposit from './recipientDeposit';
export default function ContractsEscrow() {
const sidebarItems = [
{ label: 'Escrow Initiate', to: 'initiateEscrow' },
{ label: 'Cancel Escrow', to: 'cancelEscrow' },
{ label: 'Recipient Deposit', to: 'recipientDeposit' },
{ label: 'Complete Escrow', to: 'completeEscrow' },
{ label: 'Cancel Escrow', to: 'cancelEscrow' },
];

return (
Expand All @@ -25,9 +25,9 @@ function Main() {
return (
<>
<EscrowInitiate />
<EscrowCancel />
<EscrowDeposit />
<EscrowComplete />
<EscrowCancel />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ export default function EscrowInitiate() {
function Left() {
return (
<>
<p>An escrow is initiated by one of the party, user A.</p>
<p>
This function, `initiateEscrow()`, is used to initiate an escrow. The
An escrow is initiated by one of the party, user A, by locking assets to
the escrow contract.
</p>
<p>
<code>initiateEscrow()</code> initiate an escrow. The
function accepts the following parameters:
</p>
<ul>
<li>
<b>escrowAmount (Asset[])</b> - a list of assets user A is trading /
sending
<b>escrowAmount (Asset[])</b> - a list of assets user A is trading
</li>
</ul>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ export default function EscrowDeposit() {
function Left() {
return (
<>
<p>User B can deposit funds into the escrow after initiation.</p>
<p>
This function, `recipientDeposit()`, is used to deposit funds into the
User B can deposit funds into the escrow after initiation step (
<code>initiateEscrow()</code>).
</p>
<p>
<code>recipientDeposit()</code> deposit funds into the
escrow. The function accepts the following parameters:
</p>
<ul>
<li>
<b>escrowUtxo (UTxO)</b> - the utxo of the transaction after{' '}
<code>initiateEscrow()</code>
<b>escrowUtxo (UTxO)</b> - the utxo of the transaction on the contract
</li>
<li>
<b>depositAmount (Asset[])</b> - a list of assets user B is trading /
sending
<b>depositAmount (Asset[])</b> - a list of assets user B is trading
</li>
</ul>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Left() {
return (
<>
<p>
This function, `createGiftCard()`, is used to create a gift card. The
<code>createGiftCard()</code> create a gift card. The
function accepts the following parameters:
</p>
<ul>
Expand Down
4 changes: 1 addition & 3 deletions packages/demo/components/pages/contracts/giftcard/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export default function Hero() {
code += `\n`;
code += `const { connected, wallet } = useWallet();\n`;
code += `\n`;
code += `const blockchainProvider = new BlockfrostProvider(\n`;
code += ` process.env.NEXT_PUBLIC_BLOCKFROST_API_KEY_PREPROD!\n`;
code += `);\n`;
code += `const blockchainProvider = new BlockfrostProvider(APIKEY);\n`;
code += `\n`;
code += `const meshTxBuilder = new MeshTxBuilder({\n`;
code += ` fetcher: blockchainProvider,\n`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Left() {
return (
<>
<p>
This function, <code>redeemGiftCard()</code>, is used to redeem a gift
<code>redeemGiftCard()</code> redeem a gift
card. The function accepts the following parameters:
</p>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Left() {
marketplace owner will receive a fee if it is specified.
</p>
<p>
This function, <code>purchaseAsset()</code>, is used to purchase a
<code>purchaseAsset()</code> purchase a
listed asset. The function accepts the following parameters:
</p>
<ul>
Expand Down

0 comments on commit 3c1a88e

Please sign in to comment.