Skip to main content
Back to Blog
Security7 min read

Smart Contract Vault Security: How Presello Protects Your Tokens

Presello

Why a Vault?

When you sell pre-sale tokens through an informal peer-to-peer deal, the biggest risk is that one party does not follow through. The seller might take the payment and not send the tokens. The buyer might receive the tokens and dispute the payment. Without a trusted intermediary, these transactions rely entirely on faith.

Presello eliminates this risk with a smart contract vault. When a seller lists tokens on Presello, they deposit those tokens into the vault smart contract. The tokens are held in escrow by the contract, not by any individual or company. They can only be released through authorized contract operations: to a buyer upon confirmed purchase, or back to the seller upon cancellation.

This vault-based escrow model means neither party needs to trust the other. The smart contract code defines the rules, and the blockchain enforces them. Sellers know their tokens are safe in the vault until sold or cancelled. Buyers know the tokens they are purchasing actually exist and are locked in escrow.

Contract Architecture

The Presello vault is built with Solidity 0.8.20 and deployed on the BNB Smart Chain (BSC). The choice of Solidity 0.8.x is significant because this version includes built-in overflow protection, eliminating an entire class of vulnerabilities that affected earlier smart contracts.

The vault contract follows a modular architecture with clear separation of concerns:

The deposit module handles incoming token transfers from sellers. It verifies that the token contract is valid, that the sender has approved sufficient tokens, and that the deposit amount matches the listing parameters. Each deposit is associated with a specific listing ID for traceability.

The release module handles outgoing token transfers. It can only be triggered by authorized operations: a purchase confirmation (tokens go to buyer) or a cancellation (tokens return to seller). All releases are logged with transaction details.

The admin module provides emergency controls including the ability to pause the contract (stopping all deposits and releases) and update authorized operator addresses. These controls exist for security purposes and are logged for transparency.

The contract uses OpenZeppelin's audited libraries for standard functionality including access control, reentrancy protection, and pausable operations. This reduces the attack surface by relying on battle-tested code rather than custom implementations.

Security Measures

The vault implements multiple layers of security:

Reentrancy protection prevents a malicious token contract from recursively calling the vault during a transfer to drain funds. The contract uses the checks-effects-interactions pattern and OpenZeppelin's ReentrancyGuard.

Access control ensures that only authorized addresses can trigger token releases. The contract uses a role-based system where the platform's backend service is the authorized operator, and its address is hardcoded during deployment.

Token validation checks that deposited tokens are ERC-20 compliant and match the expected token contract for the project. This prevents deposit of fake or incompatible tokens.

Balance verification ensures that the vault's internal accounting matches the actual token balances held by the contract. Any discrepancy triggers an alert through the monitoring system.

Emergency pause allows the contract to be paused instantly if a security incident is detected. When paused, all deposits and releases are blocked until the situation is resolved. This is a standard safety mechanism for high-value smart contracts.

Gas batching optimizes withdrawal transactions by batching multiple small withdrawals into a single transaction when possible, reducing gas costs for users while maintaining the same security guarantees.

The Audit Process

Before deployment to the BSC mainnet, the Presello vault smart contract undergoes a professional security audit. The audit process involves:

Code review by experienced smart contract auditors who examine every function, modifier, and state variable for potential vulnerabilities. This includes checking for common issues like reentrancy, integer overflow, access control bypasses, and logic errors.

Automated analysis using tools like Slither, Mythril, and Securify that scan the code for known vulnerability patterns. These tools complement human review by systematically checking for hundreds of known issue types.

Formal verification of critical functions to mathematically prove that they behave as intended under all possible inputs and conditions.

The audit report is published on the Presello security page for full transparency. Any issues identified during the audit are fixed and re-verified before deployment. The audit certificate is displayed on the platform as proof that the contract has been professionally reviewed.

Post-deployment, the contract is verified on BSCScan so that anyone can read the source code and confirm it matches the audited version. This open verification ensures that the deployed contract is exactly what was audited.

What the Vault Does Not Do

Transparency about limitations is as important as highlighting security features. Here is what the vault does not protect against:

The vault does not protect against the underlying token losing value. If a project fails or the token price drops after listing, the vault still holds the tokens but their value may be significantly less than what was paid.

The vault does not guarantee that a project is legitimate. While Presello's AI screening helps identify risky projects, the vault is a technical security mechanism, not a due diligence tool. A token can be securely held in the vault and still be worthless.

The vault does not protect against blockchain-level risks such as chain reorganizations, consensus failures, or smart contract vulnerabilities in the underlying blockchain platform itself.

The vault does not hold fiat currency or stablecoins for buyers. Buyer payments are processed through Guardarian or direct USDT transfer and converted to seller proceeds through the platform's payment system.

Understanding these limitations is important for making informed decisions. The vault provides strong technical security for the escrow process, but it is one component of a broader risk landscape that every buyer and seller should consider.

Key Takeaways

  • 1Tokens are held in audited Solidity smart contracts on BSC, not by any individual or company.
  • 2The vault uses reentrancy protection, access control, token validation, and emergency pause.
  • 3Professional security audits are conducted before mainnet deployment, with reports published publicly.
  • 4The vault protects against counterparty risk but does not protect against token value loss or project failure.
  • 5Source code is verified on BSCScan so anyone can review the deployed contract.
Share this article:

Presello is a peer-to-peer resale marketplace for digital credits. Presello does not endorse, verify, or guarantee any listed project. This is not an exchange. All purchases are at the buyer's own risk. Operated by Presello LLC.