Inspiration
I am a remote technical developer, and many companies and projects I work with are distributed, with team members located in different countries and time zones. Settling salaries and determining the payment method becomes a challenge in such scenarios. Currently, in the web3 , many companies are adopting cryptocurrency as a means of salary settlement. By leveraging the transparency of smart contracts and the new technologies of Chainlink, such as automation and functions, it is possible to build an automated payroll platform. This platform can not only enhance transparency and fairness but also utilize DAO for supervision and evaluation, providing a more secure environment for remote workers.
What it does
Smart Contract and Salary Disbursement: Employers and employees need to communicate in advance regarding the salary payment method. The employer creates a smart contract where the platform issues identical network contracts to both the employer and employee in the form of NFTs. The NFT records the contract creation time and contract name. The employer specifies the currency type, amount, payment cycle, and rounds, and deposits the amount into the contract.
DAO Organization and Arbitration Mechanism: The contract is regularly disbursed to the employee, ensuring their interests are protected. However, if the employer's interests are compromised during the collaboration, the employer can initiate an appeal on the snapshot.org platform, triggering a DAO vote to determine whether the violation should be acknowledged. The DAO consists of employers and employees with good credit records on the platform. They will vote on the subsequent actions based on the appeal.
Credit Scoring System and Incentive Mechanism: The platform assigns credit scores to employers and employees based on their performance in fulfilling contracts, establishing an identity credit system. Each participation in the DAO vote rewards the participants with credit points and tokens. These tokens can be used for other activities within the platform or exchanged for other forms of rewards.
Dividends for DAO Members: DAO members not only participate in decision-making but also receive dividends from the platform. In fact, they become part owners of the platform in economic terms. This provides them with further incentives and a sense of responsibility and belonging.
How we built it
Technologies: TypeScript, Node.js, Hardhat, Next.js, MongoDB. Smart Contracts: Contract NFT: Records contract time and contract name. Contract NFT Factory: Generates a new NFT contract for each contract creation, minting two identical NFTs. Credit Contract: Automatically mints NFTs for the employer and employee after successful salary disbursement. DAO Vault: In case of disputes, the amount to be disbursed in the current round is transferred to the DAO treasury, while the remaining amount is returned to the employer. After the voting ends, the DAO treasury transfers the funds to the employer or employee. Each DAO treasury contract is generated by the factory contract. Registry Contract: Registers the execution contracts to the Chainlink Automation platform, including the LINK balance. Execution Contract: Contract responsible for the timely fulfillment and salary disbursement. Execution Contract Factory: Generates a new execution contract for each contract. Functions Contract: Reads the Snapshot API and returns the voting result, enabling the execution of salary attribution based on the result. Functions Contract Factory: Generates new functions contracts for different contracts.
Challenges we ran into
Due to the whitelist requirement for address registration in functions, the execution of functions is performed through an EOA (Externally Owned Account) in the frontend.
Accomplishments that we're proud of
Salary distribution is automated, the creation of Chainlink automatic tasks is automated. The retrieval of voting results from Snapshot upon expiration is done using Chainlink functions. The execution of the employer's complaint assessment results is also automated
What we learned
- Learned how to utilize Chainlink's automation and functions.
- Learned how to independently develop a web3 product, including smart contracts, frontend, and database.
What's next for SmartPayroll
- Contract storage on AWS.
- Selection of DAO members: Platform members, employers, and employees choose an equal number of individuals proportionally.
- All DAO members receive a token value as a reward each time they participate in voting. Later, new tokens will be distributed based on this token count. The voting records of DAO members are recorded, and employees (employers) can view the historical DAO votes of the employers (employees) they are interested in.
- All historical votes are traceable to prevent the existence of a large number of unfair votes by malicious users.
- With a certain user base or accumulated funds, develop DeFi functionality.
Built With
- chainlink-automation
- chainlink-functions
- mongodb
- nextjs
- snapshot-api
- solidity
- typescript
Log in or sign up for Devpost to join the conversation.