
Research
/Security News
PolinRider Spreads Through Compromised GitHub Accounts and Packagist
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.
orchai-combinator-bsc-sdk
Advanced tools
- [Table of contents](#table-of-contents) - [TRAVA STATION SDK](#trava-station-sdk) - [Utilities](#utilities) - [Pull token](#pull-token) - [Send token](#send-token) - [Wrap token](#wrap-token) - [Unwrap token](#unwrap-token) - [Swap
import {actions} from "trava-station-sdk"
Với các actions:
const pull_token_action = new actions.basic.PullTokenAction(
token: String,
from: String,
amount: uint256
)
const send_token_action = new actions.basic.SendTokenAction(
token: String,
to: String,
amount: uint256
)
const pull_token_action = new actions.basic.PullTokenAction()
const wrap_token_action = new actions.basic.WrapBnbAction(
amount: uint256
)
const unwrap_token_action = new actions.basic.UnwrapBnbAction(
amount: uin256,
to: String
)
const swapUtil = new SwapUtil(web3);
const info = new await swapUtil.getInformationFromInput(tokenAddr1, tokenAddr2, slipparage, amount);
const minimumReceive = info.minimumReceive
const priceImpact = info.priceImpact;
const path = info.path;
const swap_token_action = new actions.pancakeswap.PancakeSwapV2(
amountIn: uint256,
amountOutMin: 0,
path: path,
to: _to address,
deadline: timestamp + 30 * 60 * 1000
from: _from address
)
const orai_ls_stake_action = new actions.OraiLiquidStakingStakeAction(
amount,
from,
contract address
)
const orai_ls_unstake_action = new actions.OraiLiquidStakingUnstakeAction(
amount,
from
)
const orai_ls_withdraw_unstake_action = new actions.OraiLiquidStakingWithdrawUnstakedAction(
to
)
Sau khi có được các action xong, để execute Freight giả sử kết hợp action supply và borrow, repay và withdraw
import {Recipe} from "trava-station-sdk";
const recipe = new Recipe(
"ten action = address user + timestamp",
[
swap_token_action,
orai_ls_stake_action,
orai_ls_unstake_action,
send_token_action
]
)
const encoded = recipe.encodeForDsProxyCall();
//sau đó dùng contract Proxy để execute (abi e để dưới), address của contract này là proxy của người dùng
let tx;
if(co action su dung BNB nhu wrap) {
tx = await proxyCOntract.execute(encoded[0], encoded[1], {value: total amountBNB});
} else {
tx = await proxyContract.execute(encoded[0], encoded[1])
}
await tx.wait();
[
{
"inputs": [
{
"internalType": "address",
"name": "_target",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "execute",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_cacheAddr",
"type": "address"
}
],
"name": "setCache",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "payable",
"type": "function"
}
]
[ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "_owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "_owner", "type": "address" }, { "internalType": "address", "name": "_spender", "type": "address" } ], "name": "allowance", "outputs": [ { "internalType": "uint256", "name": "remaining", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_spender", "type": "address" }, { "internalType": "uint256", "name": "_value", "type": "uint256" } ], "name": "approve", "outputs": [ { "internalType": "bool", "name": "success", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "balance", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [ { "internalType": "uint256", "name": "digits", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "supply", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "_value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "internalType": "bool", "name": "success", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_from", "type": "address" }, { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "_value", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "internalType": "bool", "name": "success", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" } ]
gọi hàm approve trong abi ERC20 token tham số truyền vào là:
Pull token: approve token cần pull
Swap token: approve token cần swap
Orai LS Stake: approve orai token
go to file tsconfig.json, if module != "ESNext", change module to "ESNext"
delete two folder /esm /umd if they exist
run
npm run build
after build, to publish repo on npm, change version repo in package.json (can't publish a repo have same version with repo existing on npm), if you use repo for test, please add "testnet" before each version and increase version after each time publish
if you don't login npm, please create account npm on website https://www.npmjs.com/, then login npm in terminal by running command
npm login
after you login success, you can publish repo on npm by following command
npm publish
FAQs
- [Table of contents](#table-of-contents) - [TRAVA STATION SDK](#trava-station-sdk) - [Utilities](#utilities) - [Pull token](#pull-token) - [Send token](#send-token) - [Wrap token](#wrap-token) - [Unwrap token](#unwrap-token) - [Swap
We found that orchai-combinator-bsc-sdk 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.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.

Company News
Allow myself to introduce... myself.