How worldrepublicorg/smart-contracts works
Project type and purpose
• This is a blockchain smart-contract repository (no frontend or backend servers).
• It contains three core Solidity contracts:
• TokenERC20 (the Drachma payment token)
• Staking20Base (the base income distribution mechanism)
• Staking20 (the staking logic that extends Staking20Base)
File structure
• Top level:
• LICENSE, README.md – metadata & documentation
• funding.json – off-chain configuration (e.g., treasury or reward addresses)
• Staking20Base/ – contains the .sol files (Staking20Base.sol, Staking20.sol, possibly TokenERC20.sol)
• No frontend or orchestration services—pure on-chain logic.
README for insights
• Confirms contracts’ purpose, their inheritance relationship, and deployed addresses.
• Mentions thirdweb’s base contracts (so there is an external dependency/reference, but no off-chain service).
a. Main components to include
• Ethereum (or EVM) Network – the execution environment
• Externally Owned Accounts (EOAs) or users
• TokenERC20 (Drachma) contract
• Staking20Base contract
• Staking20 contract (inherits from Staking20Base)
• Off-chain configuration store (funding.json) – optional
b. Relationships & interactions
– EOAs call Staking20.stake(amount) →
• Staking20 (child) delegates common distribution logic to Staking20Base
• Staking20 interacts with TokenERC20 to transfer tokens from user to contract
– Staking20Base manages reward balances and income distributions back to EOAs
c. Architectural patterns & design principles
– Contract inheritance (Staking20 extends Staking20Base)
– Separation of concerns:
• TokenERC20 handles ERC-20 standard logic
• Staking20Base handles reward calculation & distribution
• Staking20 handles user-facing staking functions
– Immutable on-chain flows; configuration pulled from funding.json at deployment
d. Relevant technologies & frameworks
– Solidity contracts on EVM
– thirdweb base contracts (source of Staking20Base & TokenERC20)
– JSON for configuration