
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
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 2 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.