diff --git a/packages/bridge-ui-v2/src/app.config.ts b/packages/bridge-ui-v2/src/app.config.ts index f848af06fa..fa68452bea 100644 --- a/packages/bridge-ui-v2/src/app.config.ts +++ b/packages/bridge-ui-v2/src/app.config.ts @@ -33,7 +33,7 @@ export const statusComponent = { minimumEthToClaim: 0.0001, }; -export const activitiesConfig = { +export const transactionConfig = { pageSizeDesktop: 6, pageSizeMobile: 4, blurTransitionTime: 300, diff --git a/packages/bridge-ui-v2/src/components/Activities/index.ts b/packages/bridge-ui-v2/src/components/Activities/index.ts deleted file mode 100644 index 8b9be8e643..0000000000 --- a/packages/bridge-ui-v2/src/components/Activities/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Activities } from './Activities.svelte'; diff --git a/packages/bridge-ui-v2/src/components/Icon/Icon.svelte b/packages/bridge-ui-v2/src/components/Icon/Icon.svelte index 70b055ff17..b59acea71d 100644 --- a/packages/bridge-ui-v2/src/components/Icon/Icon.svelte +++ b/packages/bridge-ui-v2/src/components/Icon/Icon.svelte @@ -2,7 +2,7 @@ export type IconType = | 'bridge' | 'faucet' - | 'activities' + | 'transactions' | 'explorer' | 'guide' | 'bars-menu' @@ -57,7 +57,7 @@ fill-rule="evenodd" clip-rule="evenodd" d="M4.65625 3.89672C6.73885 3.55347 8.87659 3.375 11.0555 3.375C13.2345 3.375 15.3722 3.55347 17.4548 3.89672C17.7693 3.94854 18 4.22039 18 4.53909V6.5249C18 7.0429 17.7942 7.53968 17.4279 7.90596L13.3637 11.9702C12.9974 12.3365 12.7916 12.8333 12.7916 13.3513V15.987C12.7916 16.5804 12.5219 17.1415 12.0586 17.5122L10.3772 18.8573C10.1817 19.0137 9.914 19.0442 9.68844 18.9357C9.46287 18.8273 9.31942 18.5992 9.31942 18.349V13.3513C9.31942 12.8333 9.11364 12.3365 8.74736 11.9702L4.68314 7.90596C4.31686 7.53968 4.11108 7.0429 4.11108 6.5249V4.53909C4.11108 4.22039 4.3418 3.94854 4.65625 3.89672Z" /> - {:else if type === 'activities'} + {:else if type === 'transactions'}
@@ -84,9 +84,9 @@
  • - - - {$t('nav.activities')} + + + {$t('nav.transactions')}
  • diff --git a/packages/bridge-ui-v2/src/components/Activities/ChainSymbolName.svelte b/packages/bridge-ui-v2/src/components/Transactions/ChainSymbolName.svelte similarity index 100% rename from packages/bridge-ui-v2/src/components/Activities/ChainSymbolName.svelte rename to packages/bridge-ui-v2/src/components/Transactions/ChainSymbolName.svelte diff --git a/packages/bridge-ui-v2/src/components/Activities/MobileDetailsDialog.svelte b/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte similarity index 93% rename from packages/bridge-ui-v2/src/components/Activities/MobileDetailsDialog.svelte rename to packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte index 4a598f1a10..2eb99c1a2f 100644 --- a/packages/bridge-ui-v2/src/components/Activities/MobileDetailsDialog.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte @@ -58,7 +58,7 @@

  • -

    {$t('activities.header.explorer')}

    +

    {$t('transactions.header.explorer')}

    - {$t('activities.link.explorer')} + {$t('transactions.link.explorer')}
  • diff --git a/packages/bridge-ui-v2/src/components/Activities/Status.svelte b/packages/bridge-ui-v2/src/components/Transactions/Status.svelte similarity index 91% rename from packages/bridge-ui-v2/src/components/Activities/Status.svelte rename to packages/bridge-ui-v2/src/components/Transactions/Status.svelte index 4ad1567dbb..fa60111f37 100644 --- a/packages/bridge-ui-v2/src/components/Activities/Status.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Status.svelte @@ -104,7 +104,7 @@ const { explorer } = chainConfig[Number(bridgeTx.destChainId)].urls; infoToast( - $t('activities.actions.claim.tx', { + $t('transactions.actions.claim.tx', { values: { token: bridgeTx.symbol, url: `${explorer}/tx/${txHash}`, @@ -116,7 +116,7 @@ //Todo: just because we have a claim tx doesn't mean it was successful successToast( - $t('activities.actions.claim.success', { + $t('transactions.actions.claim.success', { values: { network: $network.name, }, @@ -133,10 +133,10 @@ warningToast($t('messages.account.required')); break; case err instanceof UserRejectedRequestError: - warningToast($t('activities.actions.claim.rejected')); + warningToast($t('transactions.actions.claim.rejected')); break; case err instanceof InsufficientBalanceError: - errorToast($t('activities.errors.insufficient_balance')); + errorToast($t('transactions.errors.insufficient_balance')); break; case err instanceof InvalidProofError: errorToast($t('TODO: InvalidProofError')); @@ -186,7 +186,7 @@ const { explorer } = chainConfig[Number(bridgeTx.srcChainId)].urls; infoToast( - $t('activities.actions.release.tx', { + $t('transactions.actions.release.tx', { values: { token: bridgeTx.symbol, url: `${explorer}/tx/${txHash}`, @@ -197,7 +197,7 @@ await pendingTransactions.add(txHash, Number(bridgeTx.srcChainId)); successToast( - $t('activities.actions.release.success', { + $t('transactions.actions.release.success', { values: { network: $network.name, }, @@ -211,7 +211,7 @@ warningToast($t('messages.account.required')); break; case err instanceof UserRejectedRequestError: - warningToast($t('activities.actions.release_rejected')); + warningToast($t('transactions.actions.release_rejected')); break; case err instanceof InvalidProofError: errorToast($t('TODO: InvalidProofError')); @@ -262,30 +262,30 @@
    {#if !processable} - {$t('activities.status.initiated.name')} + {$t('transactions.status.initiated.name')} {:else if loading}
    - {$t(`activities.status.${loading}`)} + {$t(`transactions.status.${loading}`)}
    {:else if bridgeTxStatus === MessageStatus.NEW} {:else if bridgeTxStatus === MessageStatus.RETRIABLE} {:else if bridgeTxStatus === MessageStatus.DONE} - {$t('activities.status.claimed.name')} + {$t('transactions.status.claimed.name')} {:else if bridgeTxStatus === MessageStatus.FAILED} {:else} - {$t('activities.status.error.name')} + {$t('transactions.status.error.name')} {/if}
    diff --git a/packages/bridge-ui-v2/src/components/Activities/StatusInfoDialog.svelte b/packages/bridge-ui-v2/src/components/Transactions/StatusInfoDialog.svelte similarity index 64% rename from packages/bridge-ui-v2/src/components/Activities/StatusInfoDialog.svelte rename to packages/bridge-ui-v2/src/components/Transactions/StatusInfoDialog.svelte index 033409c02c..25d00e9da1 100644 --- a/packages/bridge-ui-v2/src/components/Activities/StatusInfoDialog.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/StatusInfoDialog.svelte @@ -55,23 +55,23 @@
    -

    {$t('activities.status.dialog.title')}

    +

    {$t('transactions.status.dialog.title')}


    - {$t('activities.status.dialog.description')} -

    {$t('activities.status.initiated.name')}

    - {$t('activities.status.initiated.description')} -

    {$t('activities.status.claim.name')}

    - {$t('activities.status.claim.description')} -

    {$t('activities.status.claimed.name')}

    - {$t('activities.status.claimed.description')} -

    {$t('activities.status.retry.name')}

    - {$t('activities.status.retry.description')} -

    {$t('activities.status.release.name')}

    - {$t('activities.status.release.description')} -

    {$t('activities.status.failed.name')}

    - {$t('activities.status.failed.description')} + {$t('transactions.status.dialog.description')} +

    {$t('transactions.status.initiated.name')}

    + {$t('transactions.status.initiated.description')} +

    {$t('transactions.status.claim.name')}

    + {$t('transactions.status.claim.description')} +

    {$t('transactions.status.claimed.name')}

    + {$t('transactions.status.claimed.description')} +

    {$t('transactions.status.retry.name')}

    + {$t('transactions.status.retry.description')} +

    {$t('transactions.status.release.name')}

    + {$t('transactions.status.release.description')} +

    {$t('transactions.status.failed.name')}

    + {$t('transactions.status.failed.description')}
    diff --git a/packages/bridge-ui-v2/src/components/Activities/Transaction.svelte b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte similarity index 98% rename from packages/bridge-ui-v2/src/components/Activities/Transaction.svelte rename to packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte index 267a1d776a..6a12fac735 100644 --- a/packages/bridge-ui-v2/src/components/Activities/Transaction.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte @@ -72,7 +72,7 @@ class="flex justify-start py-3 link" href={`${chainConfig[Number(item.srcChainId)].urls.explorer}/tx/${item.hash}`} target="_blank"> - {$t('activities.link.explorer')} + {$t('transactions.link.explorer')} diff --git a/packages/bridge-ui-v2/src/components/Activities/Activities.svelte b/packages/bridge-ui-v2/src/components/Transactions/Transactions.svelte similarity index 85% rename from packages/bridge-ui-v2/src/components/Activities/Activities.svelte rename to packages/bridge-ui-v2/src/components/Transactions/Transactions.svelte index 6a1ddda5e0..6f91ca3a9f 100644 --- a/packages/bridge-ui-v2/src/components/Activities/Activities.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Transactions.svelte @@ -9,7 +9,7 @@ import OnAccount from '$components/OnAccount/OnAccount.svelte'; import { Paginator } from '$components/Paginator'; import { Spinner } from '$components/Spinner'; - import { activitiesConfig } from '$config'; + import { transactionConfig } from '$config'; import { type BridgeTransaction, fetchTransactions } from '$libs/bridge'; import { bridgeTxService } from '$libs/storage'; import { account, network } from '$stores'; @@ -24,10 +24,10 @@ let currentPage = 1; let isBlurred = false; - const transitionTime = activitiesConfig.blurTransitionTime; + const transitionTime = transactionConfig.blurTransitionTime; let totalItems = 0; - let pageSize = activitiesConfig.pageSizeDesktop; + let pageSize = transactionConfig.pageSizeDesktop; let loadingTxs = false; @@ -85,11 +85,11 @@ } if (error) { // Todo: handle different error scenarios - warningToast($t('activities.errors.relayer_offline')); + warningToast($t('transactions.errors.relayer_offline')); } }; - $: pageSize = isDesktopOrLarger ? activitiesConfig.pageSizeDesktop : activitiesConfig.pageSizeMobile; + $: pageSize = isDesktopOrLarger ? transactionConfig.pageSizeDesktop : transactionConfig.pageSizeMobile; $: transactionsToShow = getTransactionsToShow(currentPage, pageSize, transactions); @@ -106,21 +106,21 @@
    - +
    {#if isDesktopOrLarger}
    -
    {$t('activities.header.from')}
    -
    {$t('activities.header.to')}
    -
    {$t('activities.header.amount')}
    +
    {$t('transactions.header.from')}
    +
    {$t('transactions.header.to')}
    +
    {$t('transactions.header.amount')}
    - {$t('activities.header.status')} + {$t('transactions.header.status')}
    -
    {$t('activities.header.explorer')}
    +
    {$t('transactions.header.explorer')}
    {/if} @@ -144,7 +144,7 @@ {#if renderNoTransactions}
    - {$t('activities.no_transactions')} + {$t('transactions.no_transactions')}
    {/if}
    diff --git a/packages/bridge-ui-v2/src/components/Transactions/index.ts b/packages/bridge-ui-v2/src/components/Transactions/index.ts new file mode 100644 index 0000000000..619060c9ff --- /dev/null +++ b/packages/bridge-ui-v2/src/components/Transactions/index.ts @@ -0,0 +1 @@ +export { default as Transactions } from './Transactions.svelte'; diff --git a/packages/bridge-ui-v2/src/components/Activities/state.ts b/packages/bridge-ui-v2/src/components/Transactions/state.ts similarity index 100% rename from packages/bridge-ui-v2/src/components/Activities/state.ts rename to packages/bridge-ui-v2/src/components/Transactions/state.ts diff --git a/packages/bridge-ui-v2/src/i18n/en.json b/packages/bridge-ui-v2/src/i18n/en.json index 710659a622..882231be7d 100644 --- a/packages/bridge-ui-v2/src/i18n/en.json +++ b/packages/bridge-ui-v2/src/i18n/en.json @@ -2,7 +2,7 @@ "nav": { "bridge": "Bridge", "faucet": "Faucet", - "activities": "Activities", + "transactions": "Transactions", "explorer": "Explorer", "theme": "Theme", "guide": "Guide", @@ -83,8 +83,8 @@ "cancel": "Cancel" } }, - "activities": { - "title": "Activities", + "transactions": { + "title": "Transactions", "description": "Track your bridge transactions here.", "header": { "explorer": "Explorer", diff --git a/packages/bridge-ui-v2/src/routes/activities/+page.svelte b/packages/bridge-ui-v2/src/routes/transactions/+page.svelte similarity index 50% rename from packages/bridge-ui-v2/src/routes/activities/+page.svelte rename to packages/bridge-ui-v2/src/routes/transactions/+page.svelte index 007d90b5d0..301cd51cf8 100644 --- a/packages/bridge-ui-v2/src/routes/activities/+page.svelte +++ b/packages/bridge-ui-v2/src/routes/transactions/+page.svelte @@ -1,8 +1,8 @@ - + diff --git a/packages/website/pages/docs/manuals/contributing-manual.mdx b/packages/website/pages/docs/manuals/contributing-manual.mdx index 8a05431fa4..3e27701b0b 100644 --- a/packages/website/pages/docs/manuals/contributing-manual.mdx +++ b/packages/website/pages/docs/manuals/contributing-manual.mdx @@ -1,3 +1,231 @@ -import ContributingMd from "../../../../../CONTRIBUTING.md"; +# Contributing manual - +**Table of contents:** + +- [Make a contribution](#make-a-contribution) +- [Coding standards](#coding-standards) +- [Documentation standards](#documentation-standards) + +## Make a contribution + +Here are some ways you can contribute: + +- Open a new issue [here](https://github.com/taikoxyz/taiko-mono/issues) (please check the issue does not already exist). +- Work on an existing issue (check out the [good first issues list](https://github.com/orgs/taikoxyz/projects/9/views/31) on our public project board). + +Please comment on the issue that you're interested in working on. Also, check out the [coding standards](#coding-standards) and [documentation standards](#documentation-standards) before you start working on the pull request. + +Once the pull request is merged to one of Taiko's GitHub repositories (you can see which repositories here: [2023 Taiko Contributor GitPOAP](https://www.gitpoap.io/gp/893)), you will be automatically awarded a Taiko Contributor GitPOAP. Opening a good new issue (not a spam issue) is also eligible for a GitPOAP, just leave a comment and we will manually invoke a GitHub bot that will send the GitPOAP. + +## Coding standards + +This section describes our coding standards at Taiko. + +### Pull requests + +Specify the scope of your change with a [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) in the PR title (for example, `feat(scope): description of feature`). This will be squashed and merged into the `main` branch. You can find the full list of allowed scopes [here](https://github.com/taikoxyz/taiko-mono/blob/main/.github/workflows/lint-pr.yml#L19). + +Because we squash all of the changes into a single commit, please try to keep the PR limited to the scope specified in the commit message. This commit message will end up in the automated changelog by checking which packages are affected by the commit. + +For example, `feat(scope): description of feature` should only impact the `scope` package. If your change is a global one, you can use `feat: description of feature`, for example. + +### Source code comments + +Follow the [NatSpec format](https://docs.soliditylang.org/en/latest/natspec-format.html) for documenting smart contract source code. Please adhere to a few additional standards: + +#### Comment style + +Choose `///` over `/** */` for multi-line NatSpec comments for consistency. All NatSpec comments should use `///` instead of `/** */`. Additional explanatory comments should use `//`, even for multi-line comments. + +#### Notice tag + +Omit the usage of `@notice` and let the compiler automatically pick it up to save column space. For example, this: + +``` +/// @notice This is a notice. +``` + +becomes this: + +``` +/// This is a notice. +``` + +#### Annotation indentation + +For multi-line annotations, do not "align". For example, this is **wrong**: + +``` +/** + * Here is a comment. + * @param someParam Here is a long parameter blah blah blah + * and I wrap it to here. + * @return someThing Here is a long return parameter blah + * and I wrap it to here. + */ +``` + +This is **correct**: + +``` +/** + * Here is a comment. + * @param someParam Here is a long parameter blah blah blah + * and I wrap it to here. + * @return someThing Here is a long return parameter blah + * and I wrap it to here. + */ +``` + +#### Extra line breaks + +Use extra line breaks as you see fit. By default, do not use them unless it improves the readability. + +This is **preferred**: + +``` +/** + * Here is a comment. + * @param someParam Here is a long parameter blah blah blah + * and I wrap it to here. + * @return someThing Here is a long return parameter blah + * and I wrap it to here. + */ +``` + +This is also **okay**: + +``` +/** + * Here is a comment. + * + * @param someParam Here is a long parameter blah blah blah + * and I wrap it to here. + * @return someThing Here is a long return parameter blah + * and I wrap it to here. + */ +``` + +#### Additional comments + +You can use additional comments with `//`. These can be above what it is describing **or** to the side. Try to remain consistent in what you are commenting. Do not use `/* */`. You can align comments on the side or not, whichever improves readability. + +This is **correct**: + +``` +struct Some { + // This is foo + uint256 foo; + uint256 bar; // This is bar +} +``` + +This is **wrong**: + +``` +struct Some { + uint256 foo; /* This is foo */ +} +``` + +#### Periods + +Periods are optional for comments, but recommended if it's a proper sentence. However, remain consistent in whatever file or section you are commenting. + +This is **correct**: + +``` +struct Some { + // This is foo + uint256 foo; +} +``` + +This is **wrong**: + +``` +struct Some { + // This is foo. + uint256 foo; + // This is bar + uint256 bar; +} +``` + +#### Mentioning other files in the repo + +To mention another contract file in the repo use the standard like this: + +```solidity +/// @notice See the documentation in {IProverPool} +``` + +If you are referring to some struct or function within the file you can use the standard like this: + +```solidity +/// @notice See the struct in {TaikoData.Config} +``` + +#### Documenting interfaces + +To document the implementing contract of an interface, you cannot use `@inheritdoc`, it is not supported for contracts. Thus, you should mention a statement like so: + +```solidity +/// @notice See the documentation in {IProverPool} +``` + +You can then mention implementation specific details by adding a `@dev` tag: + +```solidity +/// @notice See the documentation in {IProverPool} +/// @dev This implementation uses a ProverPool of size 32. +``` + +#### Documenting internal functions and structs + +Internal functions and structs should commented with a `@dev` tag, and you can also comment the contents of the struct with explanatory comments. + +#### Documenting user-facing functions versus internal functions + +All user-facing functions should be fully documented with NatSpec. Internal functions should always be commented with a `@dev` tag, not a `@notice` tag. + +#### Explanatory comments + +Explanatory comments use `//`. There is a common idea that the code describes the documentation. There are pros to this approach. One of the pros is that you remove the coupling between documentation and the code it's describing, that's why we should always strive for the [minimum viable documentation](https://google.github.io/styleguide/docguide/best_practices.html#minimum-viable-documentation) (one of our core documentation [philosophies](#philosophies)). It can also appear cleaner. + +It's important that our codebase is well documented with **explanatory comments**. Thus, in addition to the standard NatSpec documentation which we should apply, we should comment the more complex things in our codebase for higher readability. More important than commenting _what_ we should be concerned with commenting _why_. The _what_ does not need to be commented for obvious things, of course the code is able to achieve that. We should comment the _what_ for more complex things to aid in the reader for more quickly understanding the code. In addition to that, we should strive to answer the _why_ with comments in our code. + +Keep in mind the advantage of having minimum viable documentation. Keep the comments close to the code which it is describing, so that it does not easily go stale or out of date. + +#### Annotation ordering + +There are several annotations used in NatSpec, this is the order of precedence we use from top to bottom: + +- @title +- @author [we don't use this tag] +- @notice +- @dev +- @param +- @return +- @inheritdoc +- @custom [we don't use this tag unless we define the convention for it here] + +## Documentation standards + +This section describes our documentation standards at Taiko. + +### Philosophies + +- Create the minimum viable documentation. +- Don't repeat yourself, use links to existing documentation or inherit it. +- Keep documentation close to what it's describing (for example, in the source code). + +### Writing style + +Use the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/) as a base point of reference for writing style. Generally, don't worry too much about things like typos. What's more important is following the basic [philosophies](#philosophies) outlined above and following structural standards for highly readable and minimal documentation. + +### Creating content + +If you are interested in creating some content (video, blog post, tweet thread, visuals, etc.), you are absolutely free to do so. It's useful to get a peer review on these, if you need a peer review please reach out to the community / team on the [Taiko Discord](https://discord.gg/taikoxyz). + +If you are looking for some more guidance on creating content, you can consult the [Taiko content guide](https://hackmd.io/@taikolabs/BJurgF1bn).