PART 2: OminiSwap Project Setup
Alfred is a software engineer and cyber security specialist based in Enugu, Nigeria. He is passionate about solving real-world problems through well-crafted software and leveraging blockchain technology.
Search for a command to run...
Alfred is a software engineer and cyber security specialist based in Enugu, Nigeria. He is passionate about solving real-world problems through well-crafted software and leveraging blockchain technology.
No comments yet. Be the first to comment.
The tech industry is changing fast—but not in the way most people think. By 2026, success in engineering won’t be about chasing the newest tools or stacking buzzwords on a résumé. It will be about depth, ownership, and usefulness. Here’s a grounded l...

1. Server Streaming RPC: Description: In this type of RPC, the client sends a single request to the server, and the server responds with a stream of messages. The client reads from this stream of responses until there are no more messages. Use Case...
Email communication is a crucial aspect of many applications, and Amazon Simple Email Service (SES) provides a reliable and scalable solution for sending emails in the Amazon Web Services (AWS) environment. I've created a go package that facilitates ...

Introduction This article shows a complete setup on how you can verify a signature sent by paystack when they make a POST request to your server. I'm using the bun http router as my go lang framework. I really do not have strength for long talks, so ...
Funny title, but that's the reality from January to December. So, you're here to hear some gist about my 2023, say less. First I just want to take a moment to laugh small, 😂😂😂😂 why? the plans I had for 2023 come be like say na small pikin write a...

In a previous article which can be found here, we talked about this awesome project to be built. I asked a few questions concerning the project, one of which was "What shall we name our token?" From the look of things, we've got a name already.
Throughout this series, we would call our app OminiSwap, yunno.. like Uniswap. The reason behind this name is that, I've considered introducing an additional blockchain, you'll get to know about this new chain later on in this course. So there we have it, let the party begin already!!!!
For building and deploying the necessary contracts, I decided we make use of hardhat framework for this. So feel free to head over to their official website to see what they've got cooking. The reason behind hardhat over of course truffle is that hardhat features a better debugging experience, nothing else. For example, hardhat offers a "console.log" feature, this is useful to print out messages while you run or compile your contracts. It's as simple as importing the console package and just using console.log anywhere in the contract.
pragma solidity ^0.6.0;
import "hardhat/console.sol";
contract Token {
function transfer(address to, uint256 amount) external {
console.log("Sender balance is %s tokens", balances[msg.sender]);
console.log("Trying to send %s tokens to %s", amount, to);
require(balances[msg.sender] >= amount, "Not enough tokens");
balances[msg.sender] -= amount;
balances[to] += amount;
}
}
You know this already, we are taking the react route to building out a public-facing user interface. In it would be some starter files from the ethereum-boilerplate. Currently, It has this swap functionality that uses some cool library, but that's not our goal. We want to write the smart contract ourselves and see how the thing goes.
In as much as I'll try my very best to actually explain something that I feel would be confusing, I'll advise every beginner out there to just get some solidity superpowers from this Resource. One last thing, I'm not gonna be teaching javascript or react here, but I'll explain stuff I think could be complicated ( doubt if any would rise though).
Head over to github and clone the repo where our contracts would live. It contains a fruit of the spirit, the sword of solidity (hardhat framework), and over here holds the breast blate of javascript ( react project).
Just take your time and look through the READMEfiles for each project. For our contract project here are a few things you could do to make me happy. Run the following commands after you've gone through the whole process on the README file.
npx hardhat compile
Compiles all .sol files found inside the contracts folder.
npx hardhat test
Runs any available test suite, which can be found inside the test folder.
npx hardhat run scripts/deploy.js --network rinkeby
Deploys your contracts to the rinkeby network