
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
global-swap
Advanced tools
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
Try running some of the following tasks:
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.ts
// todo
function defineToken( address _token1, address _token2, uint rate1, uint rate2 ) public onlyRole(DEFAULT_ADMIN_ROLE) { tokenAddress[idToken] = _token1; idToken++;
tokenAddress[idToken] = _token2;
idToken++;
_currencies[_token1];
_currencies[_token2];
_rate[_token1][_token2] = rate1;
_rate[_token2][_token1] = rate2;
}
function getRate(address _from, address _to) public view returns (uint) {
return _rate[_from][_to];
}
function swapUsdt(
address _from,
address _to,
uint amount
) public view returns (uint) {
uint unit = 1 * 10 ** 9;
uint reatePerGnet = getRate(_from, _to);
uint ratePerUnit = reatePerGnet / unit;
uint gnetAmount = amount / ratePerUnit;
return gnetAmount;
// usdt.transferFrom(msg.sender, address(this), amount);
// gnet.transfer(msg.sender, gnetAmount);
}
// function swapGnet(uint amount) public view returns (uint) {
// uint formatAmount = amount * 10 ** 9;
// uint unit = 1 * 10 ** 18;
// uint usdtAmount = (formatAmount * unit) / ratePerUsdt;
// return usdtAmount;
// // gnet.transferFrom(msg.sender, address(this), amount);
// // usdt.transfer(msg.sender, usdtAmount);
// }
FAQs
token exchange
The npm package global-swap receives a total of 11 weekly downloads. As such, global-swap popularity was classified as not popular.
We found that global-swap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.