Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Zodiac Chronobox
# Chronobox by Zodiac

A vault that nobody can empty quickly.

Expand Down Expand Up @@ -68,7 +68,7 @@ The Vault Delay lets the hot wallet queue any transaction. The app builds three,

### Money in the setup

The setup has a step "Put money in now?". It lists what the wallet holds, by dollar value where the app has a price (Chainlink feeds, read through the wallet), with five rows first and ten more for each "See more". Each row has a field and a slider with stops at 25%, 50%, 75% and everything. The slider gives round amounts. The step can be skipped ("Deposit later").
The setup has a step "Add money now?". It lists what the wallet holds, by dollar value where the app has a price (Chainlink feeds, read through the wallet), with five rows first and ten more for each "See more". Each row has a field and a slider with stops at 25%, 50%, 75% and everything. The slider gives round amounts. The step can be skipped ("Add money later").

A token moves only when its holder calls it, or when a spender that the holder approved calls it. During the setup the vault still belongs to the wallet and runs the setup batch, so it can collect tokens in that batch. After the lock it can act only through the delay. So for a plain wallet the setup is the one moment when money goes in without a transaction of its own:

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "zodiac-timebox",
"name": "chronobox",
"version": "0.1.0",
"private": true,
"type": "module",
Expand Down
8 changes: 6 additions & 2 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CreatePage } from "./ui/create.tsx";
import { DevBar } from "./ui/devbar.tsx";
import { ByZodiac, Lockup } from "./ui/logo.tsx";
import { StartPage, vaultHref } from "./ui/start.tsx";
import { ImprintPage, PrivacyPage, TermsPage } from "./ui/legal.tsx";
import { ImprintPage, LegalPage, PrivacyPage, TermsPage } from "./ui/legal.tsx";
import { TechnicalPage } from "./ui/technical.tsx";
import { StatesPage } from "./ui/states.tsx";
import { VaultPage } from "./ui/vault.tsx";
Expand All @@ -30,6 +30,7 @@ type Route =
| { page: "states" }
| { page: "terms" }
| { page: "imprint" }
| { page: "legal" }
| { page: "vault"; chain: Chain; safe: Address; swap: { to: Address; upTo: bigint | null } | null }
| { page: "alerts"; chain: Chain; safe: Address }
| { page: "unknown" };
Expand All @@ -46,6 +47,7 @@ function parseRoute(hash: string): Route {
if (path === "/privacy") return { page: "privacy" };
if (path === "/terms") return { page: "terms" };
if (path === "/imprint") return { page: "imprint" };
if (path === "/legal") return { page: "legal" };
// Every state of the vault page, from `npm run scenarios`. Only in the dev server.
if (__DEV__ && path === "/states") return { page: "states" };
const alerts = /^\/alerts\/([a-z0-9]+):(0x[0-9a-fA-F]{40})$/.exec(path);
Expand Down Expand Up @@ -211,6 +213,8 @@ export function App() {
body = <TermsPage />;
} else if (route.page === "imprint") {
body = <ImprintPage />;
} else if (route.page === "legal") {
body = <LegalPage />;
} else if (route.page === "states") {
// Only the dev server has this route; the production build leaves the page out.
body = __DEV__ ? <StatesPage /> : null;
Expand Down Expand Up @@ -317,7 +321,7 @@ export function App() {
<footer class="foot">
<ByZodiac />
<span class="muted">
<a href="#/technical">How it is built</a> · <a href="#/terms">Terms</a> · <a href="#/privacy">Privacy</a> · <a href="#/imprint">Imprint</a> ·{" "}
<a href="#/technical">How it is built</a> · <a href="#/legal">Legal & imprint</a> ·{" "}
<a href={REPO} target="_blank" rel="noreferrer noopener">
GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0b0b0c">
<meta name="color-scheme" content="light dark">
<title>Zodiac Chronobox</title>
<title>Chronobox by Zodiac</title>
<meta name="description" content="A vault that nobody can empty quickly.">
<meta name="chronobox-build" content="__BUILD_HASH__">
<link rel="manifest" href="./manifest.json">
Expand Down
258 changes: 213 additions & 45 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1761,8 +1761,6 @@ a:focus-visible {
display: grid;
gap: 10px;
width: 100%;
padding-top: 14px;
border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
Expand Down Expand Up @@ -1848,36 +1846,6 @@ a:focus-visible {
font-size: inherit;
}

.balances {
list-style: none;
padding: 0;
display: grid;
gap: 6px;
}

.balances li {
display: flex;
align-items: baseline;
gap: 10px;
font-variant-numeric: tabular-nums;
}

.balance-amount {
font-size: 1.25rem;
font-weight: 600;
letter-spacing: -0.01em;
}

.balances li:first-child .balance-amount {
font-size: 2.4rem;
letter-spacing: -0.03em;
line-height: 1.1;
}

.balance-symbol {
color: var(--muted);
}

.queue {
list-style: none;
padding: 0;
Expand Down Expand Up @@ -2371,18 +2339,6 @@ a:focus-visible {
padding-top: 4vh;
}

.vault-main .balances {
justify-items: center;
}

.vault-main .balances li {
justify-content: center;
}

.balances li:first-child .balance-amount {
font-size: clamp(2.8rem, 12vw, 3.6rem);
}

.view-only {
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -3676,7 +3632,6 @@ img.token-badge.token-icon {
}

.balance-found {
margin-left: 8px;
color: var(--muted);
font-family: var(--mono);
font-size: 0.72rem;
Expand Down Expand Up @@ -3713,3 +3668,216 @@ img.token-badge.token-icon {
.many-line .amount-row {
width: 100%;
}

/* Add money: the transfer from this wallet first, then the address for any other way in */
.deposit-or {
width: 100%;
margin: 8px 0 0;
padding-top: 16px;
border-top: 1px solid var(--line);
color: var(--muted);
font-size: 0.9rem;
text-align: center;
}

/* What is in a Chronobox: a table, the asset on the left, the amount on the right */
.box-table {
width: 100%;
border: 1px solid var(--line);
border-radius: 16px;
overflow: hidden;
text-align: left;
}

.box-row {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 12px;
min-height: 54px;
padding: 0 16px;
}

.box-row + .box-row {
border-top: 1px solid var(--line);
}

.box-header {
min-height: 38px;
background: var(--panel);
color: var(--muted);
font-family: var(--mono);
font-size: 0.7rem;
letter-spacing: 0.08em;
text-transform: uppercase;
}

.box-header > :last-child,
.box-amount {
text-align: right;
}

.box-asset {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
font-weight: 600;
}

.box-asset > span {
display: grid;
min-width: 0;
}

.box-amount {
font-size: 1.05rem;
font-weight: 600;
font-variant-numeric: tabular-nums;
}

/* The amount field, with "Max" inside it */
.amount-row {
grid-template-columns: minmax(0, 1fr) auto;
}

.amount-field {
position: relative;
display: block;
min-width: 0;
}

.amount-field .amount-input {
width: 100%;
}

.amount-field-max .amount-input {
padding-right: 64px;
}

.amount-max {
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
min-height: 32px;
padding: 0 10px;
border: 0;
border-radius: 8px;
background: var(--panel);
color: var(--blue-text);
font: inherit;
font-size: 0.8rem;
font-weight: 600;
cursor: pointer;
}

.amount-max:hover:not(:disabled) {
background: var(--blue-wash);
}

.amount-max:disabled {
opacity: 0.5;
cursor: not-allowed;
}

/* Cancel: a small button at the right of a waiting card */
.queue-actions {
flex-wrap: wrap;
}

.queue-cancel {
margin-left: auto;
}

/* About when a new wait is over */
.delay-callout-when {
margin-top: 4px;
font-size: 0.86rem;
opacity: 0.8;
}

/* The token's page on the block explorer: shown when the row is pointed at */
.box-symbol {
display: inline-flex;
align-items: center;
gap: 6px;
}

.box-ext {
display: inline-grid;
place-items: center;
color: var(--muted);
opacity: 0;
transition: opacity 0.15s ease;
}

.box-row:hover .box-ext,
.box-ext:focus-visible {
opacity: 1;
}

.box-ext:hover {
color: var(--blue-text);
}

@media (hover: none) {
.box-ext {
opacity: 1;
}
}

/* Add money from a wallet that is not the one of this Chronobox: only the address, with no line above it */
.deposit-or-only {
margin-top: 0;
padding-top: 0;
border-top: 0;
}

/* Drop-downs: the arrow drawn by the page, a comfortable step in from the right edge */
.select {
-webkit-appearance: none;
appearance: none;
padding-right: 40px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236a6a70' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 16px center;
background-size: 12px 12px;
}

@media (prefers-color-scheme: dark) {
.select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%239a9aa2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
}

/* Legal & imprint: the three pages, one click each */
.legal-index {
list-style: none;
margin: 0;
padding: 0;
border: 1px solid var(--line);
border-radius: 16px;
overflow: hidden;
}

.legal-index li + li {
border-top: 1px solid var(--line);
}

.legal-index a {
display: grid;
gap: 2px;
padding: 14px 18px;
color: var(--fg);
text-decoration: none;
}

.legal-index a:hover {
background: var(--panel);
}

.legal-index span {
color: var(--muted);
font-size: 0.9rem;
}
Loading
Loading