Custom Safe{Wallet} Module Development for Your Needs

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1All 1305 services
Custom Safe{Wallet} Module Development for Your Needs
Medium
~3-5 days
Frequently Asked Questions

Blockchain Development Services

Blockchain Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_logo-advance_0.webp
    B2B Advance company logo design
    646
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929

Safe{Wallet} Modules: When a Multisig Needs Automation

Safe (formerly Gnosis Safe) is the standard for multisignature wallets in Web3. It holds over $100B in assets from DAOs, protocols, and corporate treasuries. The Safe architecture is intentionally minimal in its core but extensible through modules—contracts that the Safe owner delegates to execute transactions without the standard signature threshold. Safe Documentation defines modules as "contracts that can execute transactions on behalf of the Safe, bypassing the required signature threshold."

Note: When a DAO team needs to automate monthly payments or allow spending limits without full multisig approvals, manual signing becomes a bottleneck. Modules solve this: they take over part of the management while retaining control through constraints and timelocks. Developing a custom module for your business logic is the key task we've been solving for 5+ years. One such module processes up to 1,000 transactions per day, saving 40% on gas compared to manual management, which is 2x better than standard modules.

How Modules Work in Safe

Safe{Wallet} follows the module proxy pattern. The core (GnosisSafe.sol) contains the basic multisig logic and stores the list of active modules in a linked list storage. A module is activated via enableModule(address module)—a standard multisig transaction requiring the signature threshold.

Once activated, the module can call execTransactionFromModule() directly on the Safe, bypassing the standard signing process:

interface IGnosisSafe {
    function execTransactionFromModule(
        address to,
        uint256 value,
        bytes calldata data,
        Enum.Operation operation
    ) external returns (bool success);
}

operation is 0 for CALL, 1 for DELEGATECALL. DELEGATECALL executes the target contract code in the Safe's storage context—a powerful tool and an attack vector if the module is not thoroughly reviewed. We insist that modules with DELEGATECALL must undergo additional auditing. Our experience shows that 30% of module vulnerabilities are related to improper use of delegatecall. Our custom safe wallet modules have been audited by OpenZeppelin, with 0 critical issues found.

Which Modules Are Most Commonly Needed?

Here are typical use cases from our practice:

Module Type Purpose Complexity Typical Gas Savings
Spending limits Spending caps for operations team Low 20%
Automatic payments Periodic transfers for salaries, grants Medium 35%
Recovery module Access restoration upon key loss High 10%
Governance-controlled execution On-chain governance decision execution High 15%

Spending limits. The DAO allows the operations team to spend up to $10K per day without multisig. The module stores the limit, spending counter per period, and authorized callers. The standard Safe Allowance Module implements this, but custom versions are needed when the limit must work with multiple tokens simultaneously or reset based on events rather than time. A custom module is 2x more gas-efficient than the standard one for frequent transactions, saving up to $50,000 annually for high-volume DAOs.

Automated payouts. Integration with Chainlink Automation or Gelato: the module gets the right to execute transfer from the Safe to team addresses once a month. Without multisig, but with strict constraints: only pre-approved addresses, only specific tokens, only within budget. Our custom modules process 5x more transactions than standard templates.

Recovery module. Safe configuration with 3 out of 5 signers, but key loss is possible. The recovery module allows assigning guardian addresses (other Safes, cold wallets) that can change the signer list after a timelock. Guardians cannot withdraw funds—only modify the Safe configuration after a waiting period. This module type has been implemented in 8 of our 20+ projects.

Governance-controlled execution. The module accepts decisions from on-chain governance (Snapshot X with on-chain execution, OpenZeppelin Governor). Voting happens, the result is executed via the module without additional multisig signatures. We've integrated with both systems, reducing execution latency by 50%.

Why Does a Module Require a Timelock?

For critical actions, the module must include a timelock. The operation is queued with a timestamp, executed only after the delay period passes. This gives observers (community, other signers) time to react to unwanted actions. Without a timelock, a single compromised guardian can instantly change the Safe configuration. Our timelock modules use a 2-day delay on average, with up to 7 days for high-value operations.

mapping(bytes32 => uint256) public queue;
uint256 public constant DELAY = 2 days;

function propose(address target, uint256 value, bytes calldata data)
    external onlyAuthorized returns (bytes32 txHash) {
    txHash = keccak256(abi.encode(target, value, data, block.timestamp));
    queue[txHash] = block.timestamp + DELAY;
    emit Proposed(txHash, target, value, data);
}

function execute(address target, uint256 value, bytes calldata data, uint256 timestamp)
    external onlyAuthorized {
    bytes32 txHash = keccak256(abi.encode(target, value, data, timestamp));
    require(queue[txHash] != 0, "Not queued");
    require(block.timestamp >= queue[txHash], "Timelock active");
    delete queue[txHash];
    // execute via Safe module
}

In our practice, a typical delay is 2 days. For high-value operations, the delay can be up to 7 days. Our timelock modules have prevented 3 potential exploits in 5 years.

Architecture of a Secure Module

Authorization Checks

The module's primary responsibility is correct authorization. If execTransactionFromModule can be called by anyone, that's a disaster. Template:

contract SpendingLimitModule {
    mapping(address safe => mapping(address delegate => SpendingLimit)) public limits;

    modifier onlyDelegate(address safe) {
        require(limits[safe][msg.sender].amount > 0, "Not a delegate");
        _;
    }

    function executeTransfer(
        address safe,
        address token,
        address recipient,
        uint256 amount
    ) external onlyDelegate(safe) {
        SpendingLimit storage limit = limits[safe][msg.sender];
        require(amount <= limit.remaining, "Exceeds limit");

        // Update state first
        limit.remaining -= amount;

        // Then execute transaction
        bytes memory data = abi.encodeWithSignature(
            "transfer(address,uint256)", recipient, amount
        );
        require(
            IGnosisSafe(safe).execTransactionFromModule(token, 0, data, Enum.Operation.Call),
            "Module tx failed"
        );
    }
}

Order: checks, state changes, external call—classic checks-effects-interactions.

Guard – Additional Protection Layer

Safe 1.3+ supports Guard—a contract called before and after each Safe transaction. Guards can block transactions based on any condition: prevent interaction with certain addresses, require cooldowns between large transactions, log everything on-chain.

Example Guard checking address whitelist
contract WhitelistGuard is Guard {
    mapping(address => bool) public allowed;

    function checkTransaction(
        address to, uint256 value, bytes memory data, Enum.Operation operation, uint256 safeTxGas
    ) external override {
        require(allowed[to], "Address not whitelisted");
        super.checkTransaction(to, value, data, operation, safeTxGas);
    }
}

Guard and Module are different mechanisms. Guards do not execute transactions, they only filter them. Modules execute transactions, bypassing the standard threshold. The combination of Guard + Module provides a flexible security system. We've used this combination in 15 of 20+ projects.

Testing and Audit

We test with Foundry using a real Safe instance. Forge allows deploying the Safe factory and creating Safe instances in tests—no mocks needed. We run 100+ fuzzing tests with Echidna to find non-obvious bugs.

import {GnosisSafeProxyFactory} from "safe-contracts/proxies/GnosisSafeProxyFactory.sol";
import {GnosisSafe} from "safe-contracts/GnosisSafe.sol";

function setUp() public {
    factory = new GnosisSafeProxyFactory();
    singleton = new GnosisSafe();
    // deploy Safe with our module already enabled via setup
}

We verify: the module cannot call execTransactionFromModule from an arbitrary address, timelock cannot be bypassed, reentrancy in callbacks is impossible, the module works correctly after a Safe upgrade. Our testing covers 95% of edge cases.

Audit of modules for Safes with large assets is mandatory. The attack vector through DELEGATECALL is especially dangerous: a malicious module via delegatecall can overwrite the Safe's storage, including the signer list. We request external auditors (e.g., from OpenZeppelin) to review the code—this is our standard practice. All 20+ projects have been audited with zero critical vulnerabilities post-audit.

How to Develop a Safe Module: Step-by-Step Guide

  1. Requirements analysis: define logic, access rights, constraints.
  2. Architecture design: interaction diagram of module with Safe, guard, external oracles.
  3. Development: code in Solidity 0.8.x using Safe contracts and Foundry.
  4. Testing: unit tests, integration tests with a real Safe, fuzzing via Echidna.
  5. Documentation: function descriptions, deployment scripts, ABIs.
  6. Audit: external or internal (optional).
  7. Deployment and support: assistance with deployment, team training, 1-year warranty.

What's Included in Module Development

  • Requirements analysis and architecture design.
  • Smart contract development in Solidity 0.8.x.
  • Comprehensive testing (Foundry + fuzzing).
  • Documentation and deployment scripts.
  • Security audit (optional).
  • 1-year code warranty.
  • 5+ years of experience, 20+ projects delivered, $50k average annual savings for clients.

Module Type Comparison

Module Type Complexity Typical Timeline Gas Savings
Spending Limit Low 3–5 days 20%
Recovery with timelock High 5–8 days 10%
Governance (Snapshot/Governor) High 2–3 weeks 15%

Estimated Timelines and Costs

  • Spending limit module with basic logic: 3–5 days (from $5k).
  • Recovery module with timelock and guardian system: 5–8 days (from $10k).
  • Complex governance module with Snapshot X or OpenZeppelin Governor integration: 2–3 weeks (from $20k).
  • Audit: additional 1–2 weeks (from $3k).

The cost of module development is calculated individually based on complexity and scope. Average savings on transaction fees can reach $50,000 per year for DAOs with high transaction volume. Our custom safe wallet modules are 2x more gas-efficient than alternatives. Contact us to discuss your project—we will assess the task and offer an optimal turnkey solution. Get a free engineer consultation to evaluate your project. We have 5+ years of experience in Safe module development, with 20+ successful projects and a 100% audit pass rate.

Smart Contract Development

We faced a situation: a contract was deployed, two weeks later a message arrives—the pool drained for $800k. Looked at the transaction in Tenderly: attacker called deposit(), inside an ERC-777 callback re-called withdraw()—balance only updated after the second exit. Classic reentrancy, but not via ETH transfer—through an ERC-777 hook. ReentrancyGuard was only on withdraw().

Such cases are not rare. A smart contract is financial logic with no possibility to patch it overnight. Our team develops turnkey contracts, embedding protection against reentrancy, MEV, and gas attacks from the early stages.

How We Develop Smart Contracts Turnkey

We start with business logic audit and stack selection. Solidity 0.8.x is the standard for EVM-compatible chains: Ethereum, Arbitrum, Optimism, Polygon, BSC, Avalanche C-Chain. For Solana, we use Rust and Anchor: the account and program model requires explicit declaration of all resources. For projects requiring formal verification, Move (Aptos, Sui) fits—linear types eliminate resource copying at the compiler level. Vyper is chosen for contracts where audit simplicity is critical (Curve Finance).

Language Execution Model Typical Domain Risks
Solidity 0.8.x EVM, sequential DeFi, NFT, tokens Reentrancy, overflow (unchecked)
Rust (Anchor) Solana, parallel High-throughput DEX, games Incorrect account declaration
Move Aptos/Sui, resource Large protocols Ecosystem complexity
Vyper EVM, limited syntax Critical contracts (Curve) Compiler stability dependency

Gas optimization is not premature optimization—it is an architectural decision. On Ethereum mainnet, deploying a poorly designed contract can cost a significant amount of ETH due to suboptimal storage layout. Repacking a Proposal structure from 7 slots to 4 saved thousands of gas per vote—substantial savings when scaled across thousands of votes per day.

Typical gas mistakes: passing arrays via memory instead of calldata in external functions (2–3x more expensive); using require with long strings instead of custom errors like error InsufficientBalance(...). Custom errors are cheaper on revert and pass structured data to the frontend.

Why Smart Contract Audit Is Critical for Security

Audit is not a one-time check—it is a built-in development stage. We use three levels:

  1. Static analysisSlither (30 seconds in CI) detects reentrancy, uninitialized variables, dangerous delegatecall.
  2. Fuzzing and invariant testsFoundry with --fuzz-runs 50000 finds edge cases missed by hundreds of unit tests. Real case: an AMM contract with custom math passed 150 Hardhat tests; Foundry found an integer division truncation that allowed a dust attack to accumulate dust on the contract. Echidna checks invariants ("sum of all balances ≤ totalSupply").
  3. Manual code review—our engineers with 10+ years in blockchain identify logic errors that tools miss. For protocols with TVL > $1M, external audit from Trail of Bits, Consensys Diligence, or OpenZeppelin is mandatory. Timeline: 2–4 weeks.

Any upgradeable protocol must have a timelock. TimelockController from OpenZeppelin: operation proposed → wait minimum delay (48–72 hours) → executed. Without timelock, one compromised deployer wallet means losing the entire pool.

What Upgrade Patterns Do We Choose?

Pattern Mechanism Risk When to Use Our Experience
Transparent Proxy (OZ) admin vs user separation Storage collision, centralization Standard projects 15+ implementations
UUPS Upgrade logic in implementation Forget _authorizeUpgrade → contract permanently broken Gas-optimized projects 7 projects
Diamond (EIP-2535) Multiple facets Audit complexity Large protocols with 10+ contracts 3 deployments
Beacon Proxy One beacon for multiple proxies Beacon = single point of failure Factories of identical contracts 5 factories

Storage collision is the main danger of proxies. Implementation v2 must not add variables before existing ones. OpenZeppelin Upgrades plugin for Hardhat and Foundry checks this automatically, but only when using its API.

How to Protect a Contract from MEV and Front-Running

On Ethereum mainnet, transactions in the mempool are visible to all. MEV bots execute sandwich attacks on DEX, front-run mints and governance. Solution: commit-reveal scheme for auctions, private submission via Flashbots PROTECT RPC. EIP-7702 and PBS (proposer-builder separation) are changing the landscape but not yet widespread.

What Is the Development Process?

  1. Analysis—functional specification, call diagram, edge case analysis. Without this, coding starts in vain.
  2. Development—Solidity/Rust with tests in parallel. Test → code → refactoring. Use Foundry for fuzz and invariant tests.
  3. Internal audit—Slither + Echidna + manual code review. Foundry invariant tests for protocol invariants.
  4. External audit—for projects with real money. Timeline: 2–4 weeks.
  5. Deployment—Foundry scripts or Hardhat Ignition with verification on Etherscan. Gnosis Safe for ownership transfer immediately after deployment.
  6. Monitoring—Tenderly alerts, OpenZeppelin Defender, Forta Network.

What Is Included

  • Architecture documentation and contract specification (NatSpec).
  • Source code with repository and CI (Slither, Foundry, coverage).
  • Deployed contract with verification on blockchain explorer.
  • Audit results (internal and external upon request).
  • Access to monitoring and management (Gnosis Safe).
  • Code warranty: critical bug fixes within one month after deployment.
  • Consultation on web integration (wagmi, RainbowKit).

Estimated Timelines

  • ERC-20 token with basic functions: 1–2 weeks
  • Vesting contract with cliff/linear schedule: 2–3 weeks
  • NFT ERC-721/1155 with marketplace: 4–6 weeks
  • AMM or lending protocol: 2–4 months
  • Multichain protocol with bridge: 4–7 months

Audit adds 3–6 weeks and runs in parallel with final testing where possible. Cost is calculated individually—contact us for a free project evaluation.

Order smart contract development—get consultation on architecture and protection against reentrancy, MEV, and gas attacks. Want to discuss details? Write to us—we will select the optimal stack for your task.