Skip to content

Commit c04429f

Browse files
authored
Merge pull request #213 from crytic/ahpaleus_master
Fix broken links
2 parents db68c1e + 6cafeb1 commit c04429f

File tree

15 files changed

+50
-26
lines changed

15 files changed

+50
-26
lines changed

.github/workflows/check_links.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Check Markdown links
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
pull_request:
9+
schedule:
10+
# run CI at 09:00, on day 1 of the month even if no PRs/merges occur
11+
- cron: '0 9 1 * *'
12+
13+
jobs:
14+
markdown-link-check:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@master
18+
- uses: gaurav-nelson/github-action-markdown-link-check@v1
19+
with:
20+
use-quiet-mode: 'yes'

development-guidelines/workflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Visually inspect critical security features of your code:
2121

2222
Document critical security properties and use automated test generators to evaluate them:
2323

24-
- [ ] Learn to [document security properties for your code](/program-analysis/). It's tough as first, but it's the single most important activity for achieving a good outcome. It's also a prerequisite for using any of the advanced techniques in this tutorial.
24+
- [ ] Learn to [document security properties for your code](../program-analysis/). It's tough as first, but it's the single most important activity for achieving a good outcome. It's also a prerequisite for using any of the advanced techniques in this tutorial.
2525
- [ ] Define security properties in Solidity, for use with [Echidna](https://github.com/crytic/echidna) and [Manticore](https://manticore.readthedocs.io/en/latest/verifier.html). Focus on your state machine, access controls, arithmetic operations, external interactions, and standards conformance.
26-
- [ ] Define security properties with [Slither's Python API](/program-analysis/slither). Focus on inheritance, variable dependencies, access controls, and other structural issues.
26+
- [ ] Define security properties with [Slither's Python API](../program-analysis/slither). Focus on inheritance, variable dependencies, access controls, and other structural issues.
2727

2828
Finally, be mindful of issues that automated tools cannot easily find:
2929

not-so-smart-contracts/cairo/consider_L1_to_L2_message_failure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Consider L1 to L2 message failure
22

3-
In Starknet, [Ethereum contracts can send messages from L1 to L2, using a bridge](https://starknet.io/docs/hello_starknet/l1l2.html#messages-from-l1-to-l2). However, it is not guaranteed that the message will be processed by the sequencer.
3+
In Starknet, [Ethereum contracts can send messages from L1 to L2, using a bridge](https://docs.starknet.io/documentation/architecture_and_concepts/L1-L2_Communication/messaging-mechanism/). However, it is not guaranteed that the message will be processed by the sequencer.
44
For instance, a message can fail to be processed if there is a sudden spike in the gas price and the value provided is too low. For that reason, Starknet developers provided a
5-
[API to cancel on-going messages](https://docs.starknet.io/docs/L1-L2%20Communication/messaging-mechanism/#l1--l2-messages)
5+
[API to cancel on-going messages](https://docs.starknet.io/documentation/architecture_and_concepts/L1-L2_Communication/messaging-mechanism/#l2-l1_message_cancellation)
66

77
# Example
88

not-so-smart-contracts/cairo/replay_protection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Consider the following function that validates a signature for EIP712-style perm
1212

1313
## Mitigations
1414

15-
- Consider using the [OpenZeppelin Contracts for Cairo Account contract](https://github.com/OpenZeppelin/cairo-contracts/blob/main/docs/Account.md) or another existing account contract implementation.
15+
- Consider using the [OpenZeppelin Contracts for Cairo Account contract](https://github.com/OpenZeppelin/cairo-contracts/blob/main/docs/modules/ROOT/pages/accounts.adoc) or another existing account contract implementation.
1616

1717
## External Examples
1818

not-so-smart-contracts/cairo/view_state/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# State modifications in a view function
22

3-
StarkNet provides the @view decorator to signal that a function should not make state modifications. However, this is [not currently enforced by the compiler](https://starknet.io/docs/hello_starknet/intro.html). Developers should take care when designing view functions but also when calling functions in other contracts as they may result in unexpected behavior if they do include state modifications accidentally.
3+
StarkNet provides the @view decorator to signal that a function should not make state modifications. However, this is [not currently enforced by the compiler](https://www.cairo-lang.org/docs/hello_starknet/intro.html). Developers should take care when designing view functions but also when calling functions in other contracts as they may result in unexpected behavior if they do include state modifications accidentally.
44

55
## Example
66

not-so-smart-contracts/cosmos/broken_bookkeeping/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ A malicious user can screw an exchange rate in two ways:
5353
* by force-sending Tokens to the module, changing the `tokensHeld` value
5454
* by transferring uTokens to another chain via IBC, chaning `uTokensInCirculation` value
5555

56-
The first "attack" could be pulled of by sending [`MsgSend`](https://docs.cosmos.network/main/modules/bank/03_messages.html#msgsend) message. However, it would be not profitable (probably), as executing it would irreversibly decrease an attacker's resources.
56+
The first "attack" could be pulled of by sending [`MsgSend`](https://docs.cosmos.network/main/modules/bank#msgsend) message. However, it would be not profitable (probably), as executing it would irreversibly decrease an attacker's resources.
5757

5858
The second one works because the IBC module [burns transferred coins in the source chain](https://github.com/cosmos/ibc-go/blob/48a6ae512b4ea42c29fdf6c6f5363f50645591a2/modules/apps/transfer/keeper/relay.go#L135-L136) and mints corresponding tokens in the destination chain. Therefore, it will decrease the supply reported by the `x/bank` module, increasing the exchange rate. After the attack the malicious user can just transfer back uTokens.
5959

not-so-smart-contracts/cosmos/unregistered_msg_handler/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Unregistered message handler
22

3-
In the legacy version of the [Msg Service](https://docs.cosmos.network/v0.44/building-modules/msg-services.html#implementation), all messages have to be registered in a module keeper's `NewHandler` method. Failing to do so would prevent users from sending the not-registered message.
3+
In the legacy version of the `Msg Service`, all messages have to be registered in a module keeper's `NewHandler` method. Failing to do so would prevent users from sending the not-registered message.
44

5-
In [the recent Cosmos version manual registration is no longer needed](https://docs.cosmos.network/v0.44/architecture/adr-031-msg-service.html#pros).
5+
In [the recent Cosmos version manual registration is no longer needed](https://docs.cosmos.network/v0.47/building-modules/msg-services).
66

77
## Example
88

not-so-smart-contracts/substrate/randomness/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To use randomness in a Substrate pallet, all you need to do is require a source
44
1. `random_seed`: This function takes no arguments and returns back a random value. Calling this value multiple times in a block will result in the same value.
55
2. `random`: Takes in a byte-array (a.k.a "context-identifier") and returns a value that is as independent as possible from other contexts.
66

7-
Substrate provides the [Randomness Collective Flip Pallet](https://paritytech.github.io/substrate/master/pallet_randomness_collective_flip/index.html) and a Verifiable Random Function implementation in the [BABE pallet](https://paritytech.github.io/substrate/master/pallet_babe/index.html). Developers can also choose to build their own source of randomness.
7+
Substrate provides the [Randomness Collective Flip Pallet](https://docs.rs/pallet-randomness-collective-flip/latest/pallet_randomness_collective_flip/) and a Verifiable Random Function implementation in the [BABE pallet](https://paritytech.github.io/substrate/master/pallet_babe/index.html). Developers can also choose to build their own source of randomness.
88

99
A bad source of randomness can lead to a variety of exploits such as the theft of funds or undefined system behavior.
1010

program-analysis/echidna/Exercise-8.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ We recommend to first try without reading the following hints. The hints are in
3939

4040
- The invariant that we are looking for is "an attacker cannot get almost whole amount of rewards"
4141
- Read what is the [multi abi option](https://github.com/crytic/building-secure-contracts/blob/master/program-analysis/echidna/common-testing-approaches.md#external-testing)
42-
- A template is provided in [contracts/the-rewarder/EchidnaRewarder.sol](https://github.com/crytic/damn-vulnerable-defi-echidna/blob/hints/contracts/the-rewarder/EchidnaRewarder.sol)
4342
- A config file is provided in [the-rewarder.yaml](https://github.com/crytic/damn-vulnerable-defi-echidna/blob/solutions/the-rewarder.yaml)
4443

4544
## Solution

program-analysis/manticore/adding-constraints.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
**Table of contents:**
44

5-
- [Introduction](#introduction)
6-
- [Operators](#Operators)
7-
- [Constraints](#constraints)
8-
- [Checking Constraint](#checking-constraint)
9-
- [Summary: Adding Constraints](#summary-adding-constraints)
5+
- [Adding Constraints](#adding-constraints)
6+
- [Introduction](#introduction)
7+
- [Operators](#operators)
8+
- [Constraints](#constraints)
9+
- [Global constraint](#global-constraint)
10+
- [State constraint](#state-constraint)
11+
- [Checking Constraint](#checking-constraint)
12+
- [Summary: Adding Constraints](#summary-adding-constraints)
1013

1114
## Introduction
1215

@@ -68,7 +71,7 @@ m.transaction(caller=user_account,
6871

6972
### State constraint
7073

71-
Use [state.constrain(constraint)](https://manticore.readthedocs.io/en/latest/api.html?highlight=operator#manticore.core.state.StateBase.constrain) to add a constraint to a specific state
74+
Use [state.constrain(constraint)](https://manticore.readthedocs.io/en/latest/states.html?highlight=statebase#manticore.core.state.StateBase.constrain) to add a constraint to a specific state
7275
It can be used to constrain the state after its exploration to check some property on it.
7376

7477
## Checking Constraint

0 commit comments

Comments
 (0)