Repository navigation
Conversation
Lender offers a zero-interest loan and escrows a grant that unlocks on repayment (saving-circles Microloans contract). Behind the `microloans` feature flag: - /new/microloan: offer a loan (approve + create), optional borrower and plain-language agreement hashed into termsHash - /microloans/[id]: borrower accepts (pasted agreement must match) and repays; anyone releases the grant once repaid; lender sets the borrower, cancels, extends the deadline, reclaims the grant when overdue, and collects repayments - Microloans list on the account page - Low-balance hint links to MiniPay Add Cash - waitForTxReceipt now returns the receipt so create can read LoanCreated Chain state only for now: no Supabase metadata or invite links.
👷 Deploy request for app-stacks pending review.Visit the deploys page to approve it
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Microloans stack type for the step-up microloans contract (BreadchainCoop/saving-circles#198): a lender offers a zero-interest loan to one borrower and escrows a grant that unlocks once the loan is repaid. Everything is behind the new
microloansfeature flag.What's in it
/new/microloan: offer a loan (approve +create). Optional borrower address and a plain-language agreement whose hash becomestermsHash./microloans/[id]:waitForTxReceiptnow returns the receipt, so create can readLoanCreated. Existing callers ignore the return value.Chain state only for now: no Supabase metadata or invite links.
Testnet deployment
Microloans is deployed on Celo Sepolia at
0xbB1428678354c1694188066Bf5C04BcfaD5C9653, with test USDC (0x01C5C0122039549AD1493B8220cABEdD739BC44E) allowed.To make the deploy preview usable (needs a maintainer)
Add these to the deploy-preview environment in Netlify. It must be a Celo Sepolia environment (
NEXT_PUBLIC_CHAIN_ID=11142220, USDC deposit token with 6 decimals):NEXT_PUBLIC_MICROLOANS_CONTRACT_ADDRESS=0xbB1428678354c1694188066Bf5C04BcfaD5C9653"microloans":{"enabled":true}added toNEXT_PUBLIC_FEATURESTesting
pnpm lint,tsc, andprettier --check .pass.window.ethereum.isMiniPayshim, at a 375px viewport. Exercised these flows and checked the on-chain results: