Tokenized Agreement Infrastructure for On-Chain Financial Contracts
Onchain Agreements is a modular smart contract system that enables the creation of tokenized financial agreements with governance and profit distribution mechanisms.
The protocol allows operators to deploy independent agreement contracts where participants receive ERC-20 tokens representing their participation rights and governance power.
These agreements can be used for a wide range of financial coordination use cases including investment deals, profit-sharing partnerships, DAO treasury agreements, and structured fundraising mechanisms.
The system is implemented in Solidity and built using the **Foundry development framework.
Each agreement is represented by a smart contract that deploys its own ERC-20 token representing participation or ownership.
Participants holding these tokens can interact with the agreement and participate in governance.
Agreements can require a voting quorum before certain actions are executed, such as unlocking funds or enabling profit distribution.
This allows multiple stakeholders to coordinate decisions securely.
The protocol supports stablecoin-based profit distribution according to predefined agreement parameters.
Participants can receive profits proportionally based on their token holdings.
The protocol uses a factory contract pattern, allowing new agreements to be deployed efficiently while keeping each agreement isolated.
This architecture enables:
- scalable deployments
- independent contract logic
- easier auditing
- modular governance structures
The system is composed of several main components.
Factory Contract
│
│ deploys
▼
Agreement Contract
│
├── ERC20 Participation Token
├── Governance Voting Mechanism
├── Token Lock / Unlock Logic
└── Profit Distribution System
Each agreement functions as an independent financial contract with configurable parameters.
Responsible for deploying new agreements.
Main responsibilities:
- create new Agreement contracts
- configure agreement parameters
- enforce operator permissions
- emit deployment events
Represents an individual financial agreement between participants.
Key capabilities:
- deploy ERC-20 participation token
- manage voting quorum
- control token locking and unlocking
- track votes from authorized voters
- enforce agreement deadlines
- distribute profits
Custom ERC-20 token implementation used to represent participant shares within each agreement.
Features include:
- configurable name and symbol
- configurable decimals
- initial supply minted at deployment
The protocol supports a governance structure that includes:
- operators responsible for creating agreements
- voters authorized to participate in governance decisions
- token holders representing agreement participants
Certain actions such as unlocking tokens or adjusting parameters require reaching a minimum quorum of votes.
Security is an important aspect of the protocol design.
Key protections implemented include:
- reentrancy protection
- restricted administrative functions
- quorum-based governance execution
- modular contract separation
Before production deployment it is recommended to perform:
- professional smart contract audit
- economic attack analysis
- extensive unit testing
src/
│
├── Agreement.sol
├── Factory.sol
├── ERC20Token.sol
│
├── ERC20/
│ ├── ERC20.sol
│ ├── IERC20.sol
│ └── extensions/
│
├── Role/
│ ├── Governable.sol
│ └── Roles.sol
│
├── security/
│ └── ReentrancyGuard.sol
│
└── utils/
├── Context.sol
├── Ownable.sol
└── SafeMath.sol
The project uses the **Foundry toolkit for development, testing, and deployment.
curl -L https://foundry.paradigm.xyz | bash
foundryup
forge build
forge test
forge script script/Deploy.s.sol --broadcast
Onchain Agreements can be used to build various decentralized financial coordination systems such as:
- investment syndicates
- profit-sharing partnerships
- startup fundraising agreements
- DAO treasury allocations
- tokenized joint ventures
Because each agreement is deployed independently, the protocol supports high flexibility for different financial arrangements.
Planned enhancements may include:
- multi-signature governance support
- snapshot-based voting
- upgradeable agreement templates
- gas optimization
- enhanced profit distribution models
- protocol analytics tools
Yaghoub Adelzadeh Blockchain Engineer
GitHub https://github.com/dappteacher
MIT License