casper security audit partner safeedges

Most of what decides how an audit goes happens before it starts. A team that shows up with frozen code, a clear scope and a short spec gets a faster audit, a lower quote and a more useful report than one that hands over a moving branch and says “audit everything”.

Safe Edges is the audit support partner for Casper Forward, and with cohort teams heading towards mainnet, we wrote this guide so you can get your project audit-ready before you reach out. It covers what to prepare, what we look for in Casper contracts and AI agents, how our process works, and how Forward teams get started.

What an audit is, and what it isn’t

An audit is a time-boxed review of a specific version of your code by security researchers. They read it line by line, test it against how you say it should behave, and report where it can be broken, drained or misused.

Three things follow from that:

  • It covers a snapshot. The report applies to the commit that was reviewed. Code you change afterwards is not covered until it is reviewed again.
  • It checks code against intent. Auditors can only tell you the contract does the wrong thing if they know what the right thing is. That is why documentation matters as much as code.
  • It reduces risk, it does not remove it. An audit is one layer. Tests, careful key management, monitoring and a sensible launch plan are the others.

The audit-readiness checklist

Unclear scope is the main reason quotes come back high and audits run long. Each item below removes a question an auditor would otherwise have to guess at.

1. Freeze the code

  • Share a specific commit hash, not a branch name. A branch keeps moving, a commit does not.
  • Stop feature work on the in-scope code for the length of the audit. Changes made mid-audit are either unreviewed or cost extra days.
  • Finish the features you plan to launch with first. Auditing half-built code means paying twice.

2. Define the scope

  • List the files and contracts that are in scope, and the ones that are explicitly out.
  • Give the size: lines of code without comments and blank lines, and the number of contracts or modules.
  • Mark the boundaries where in-scope code calls something out of scope, such as another contract, an oracle or a backend service.
  • State the language and framework versions, for example the Odra and casper-types versions you build against.

3. Write down how it should behave

This does not need to be a polished whitepaper. A few pages are enough if they cover:

  • What each contract is for, in plain language
  • How funds move through the system, from deposit to withdrawal
  • Roles and permissions: who can call what, and what the admin can and cannot do
  • The rules that must always hold, for example “total shares never exceed total deposits” or “only the owner can change the fee”
  • A simple architecture diagram, if you have one

4. Bring your tests

  • Make sure the test suite runs and passes on the frozen commit.
  • Cover the main flows and the obvious failure cases, not just the happy path.
  • Deploy to Casper Testnet and run through the real user journey at least once. Bugs found there are free. Bugs found in an audit cost you audit days.
  • Be honest about coverage. Knowing what is untested tells auditors where to look harder.

5. List your dependencies

  • External contracts and protocols you call
  • Oracles and price feeds
  • Tokens you accept, especially ones with unusual behaviour
  • Off-chain pieces the contracts trust: backends, signers, AI agents, relayers

6. Flag what worries you

Tell us about the parts you are least sure of: custom maths, upgrade logic, anything with admin power, code you wrote in a hurry. Pointing at known weak spots does not make the audit harsher. It makes it more useful.

7. Plan the timeline

  • Share your target launch date and any hard deadlines.
  • Leave time after the draft report to fix issues and have the fixes re-checked. Launching the day after the draft arrives is not a plan.
  • Name one person on your team who can answer auditor questions quickly during the review.

8. Sort out access

  • For private repos, be ready to add our auditor’s GitHub handle.
  • Share build and test instructions that work from a clean checkout.

What we look for in Casper contracts

Casper contracts are written in Rust and compiled to Wasm, and many teams build them with the Odra framework. Rust and Odra remove some classic bugs, but the issues that cost projects money are mostly logic and permission mistakes, which no compiler catches. These are the areas worth checking yourself before the audit.

AreaWhat to check
InitialisationSetup logic runs once, at install, and cannot be called again by anyone afterwards. Starting values such as owner, fees and limits are validated.
Access controlEvery entry point that changes state or moves funds checks who is calling. Admin-only functions are actually restricted, and there is a way to transfer ownership safely.
Admin powersWhat the admin can do is deliberate and documented. An admin key should not be able to quietly drain user funds or change the rules mid-flight.
UpgradesDecide whether the contract is upgradable or locked, and say which. If it is upgradable, be clear who holds that power and how it is protected.
Purses and CSPR handlingPayable entry points account for the exact amount attached. Purses the contract controls are not exposed with more access rights than needed.
Input validationFees, percentages, addresses and amounts passed in are bounds-checked. A fee that can be set above 100% is a bug waiting to be used.
Accounting and mathsBalances and totals stay consistent across every path, including removals and partial withdrawals. Rounding always favours the protocol, not the caller.
Edge casesFirst deposit, last withdrawal, zero supply, zero amount, the same item added twice. Exchange-rate and share calculations often break at exactly these points.
Cross-contract callsState is updated before calling out to other contracts, and calls that could re-enter are guarded. Return values and failures from external calls are handled.
Randomness and timeNothing valuable depends on values a validator or caller can predict or influence.
Gas and sizeNo unbounded loops over user-growable lists. The compiled Wasm is built in release mode, stripped, and comfortably under the transaction size limit.
EventsImportant state changes emit events, so you and your users can monitor the contract after launch.

Casper’s own guidance is worth a read alongside this: see the Casper best practices for on-chain code and the Odra documentation.

If your project uses AI agents

Many Forward teams are building agents that hold keys, sign transactions or make payments on a user’s behalf. A smart contract audit alone does not cover that. The agent, its tools and the backend it runs on are part of the attack surface, and they need their own review.

Before an audit, be ready to show:

  • What the agent is allowed to do. Which wallets it controls, which contracts it can call, and what spending limits apply. Limits enforced on-chain are far stronger than limits written in a prompt.
  • Where the keys live. How the agent’s keys are stored, who else can reach them, and what happens if the server is compromised.
  • What the agent reads. Any content it takes in from users, web pages, other agents or tool outputs can carry instructions. Show how untrusted input is kept from steering the agent into moving funds.
  • Which tools and MCP servers it uses. Each one is a dependency with its own permissions. List them, and what each can access.
  • How a human can step in. Approval steps for large or unusual actions, a way to pause the agent, and logs that show what it did and why.
  • How payments are verified. For agentic payment flows, how the agent confirms it is paying the right party the right amount, and that a payment cannot be replayed.

We covered this in more depth in When AI Agents Get Financial Authority and Is Your AI Agent Secure? on our blog.

How a Safe Edges audit works

  1. Intake and scoping. You share the repo, commit and scope. We review the code and send a fixed quote and timeline.
  2. Kick-off. We open a Telegram group with your team and our auditors, so questions get answered the same day instead of waiting for a call.
  3. Audit. Our lead auditor reviews the code line by line, using manual review alongside automated tooling. The findings are then verified by our CISO.
  4. Draft report. You receive every finding with its severity, an explanation of the impact, and a recommended fix.
  5. Fixes. Your team fixes the issues, and we help where it is useful.
  6. Re-verification. We check each fix against the original finding and confirm it is resolved without introducing new problems.
  7. Final report. You get the final report, which you can publish and share with Casper, investors and your community.

How long this takes depends on the size and complexity of the code. A small, well-prepared codebase can be turned around in about a week. Larger systems take longer, and we confirm the timeline with the quote.

How Casper Forward teams get started

We have set up a dedicated intake page for the cohort: safeedges.in/casper-forward.

Fill in the short form with your project name, repo, what is in scope and your target launch date. We will reach out on Telegram within 1-2 business days to scope the project. Scoping is free, and Forward teams get priority scheduling ahead of their launch dates.

You do not need to have everything on the checklist finished before you submit. If you are a few weeks from being ready, tell us your timeline and we will plan around it.

Quick checklist

☐  Code frozen at a specific commit

☐  In-scope and out-of-scope files listed, with line count

☐  Short spec: purpose, flow of funds, roles, rules that must always hold

☐  Tests passing, and a full run-through on Casper Testnet

☐  Dependencies listed, including off-chain services and agents

☐  Known weak spots flagged

☐  Launch date shared, with time left for fixes and re-checks

☐  Repo access and build instructions ready

About Safe Edges

Safe Edges is a Web3 security firm and part of Circle’s Alliance Program. We are official security partners of the Fuel, ENI and X1 EcoChain ecosystems, with 200+ projects audited, $4B+ in TVL secured and zero post-audit hacks. Our public audit reports are at safeedges.in/reports.

Contact:

Email: vivanchauhan@safeedges.in

Website: https://safeedges.in

Casper Forward intake: https://safeedges.in/casper-forward

LEAVE A REPLY

Please enter your comment!
Please enter your name here