Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for trusted method analysis #320

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

johspaeth
Copy link
Contributor

This PR adds documentation for a new built in rule to detect trusted and untrusted methods.

@johspaeth johspaeth added the release documentation for an upcoming release label Dec 18, 2024
Copy link
Contributor

@urikirsh urikirsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good with small comments. I overall think this can also benefit from an example; I believe we will make one in the Examples repo, and I think we should link to it after it's been merged there.

potentially untrusted.

I.e. a method call is trusted iff at the call site:
1. the target contract address is resolvable and is known to be a fixed address (along all possible execution path) _and_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. the target contract address is resolvable and is known to be a fixed address (along all possible execution path) _and_
1. the target contract address is resolvable and is known to be a fixed address (along all possible execution paths) _and_


I.e. a method call is trusted iff at the call site:
1. the target contract address is resolvable and is known to be a fixed address (along all possible execution path) _and_
2. the method sighash is resolvable and is known to be fixed (also along all possible execution path) _and_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. the method sighash is resolvable and is known to be fixed (also along all possible execution path) _and_
2. the method sighash is resolvable and is known to be fixed (also along all possible execution paths) _and_

"prover_resource_files": ["trustedMethods:ExampleTrustedMethod.json"],
```

3. Create a file called `ExampleTrustedMethod.json` in the folder you are executing `certoraRun` command from. Within the file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Create a file called `ExampleTrustedMethod.json` in the folder you are executing `certoraRun` command from. Within the file
3. Create a file called `ExampleTrustedMethod.json` in the folder from which you are executing the `certoraRun` command. Within the file

"0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed": ["0x7e2a6db8","0xb23d4266"]
}
```
Here `["0x7e2a6db8","0xb23d4266"]` is the list of methods with signatures `["trusted()","untrusted()"]`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit weird to use the function untrusted() as an example of a trusted command, maybe better to use a different name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release documentation for an upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants