Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@acala-network/contracts
Advanced tools
Generate bytecode for predeployment of ERC20 smart contracts in Acala.
Run yarn
to install dependencies.
To generate bytecode, run yarn run generate-bytecode
.
The generated bytecode JSON file would be ./resources/bytecodes.json
. The contracts are in ./contracts/tmp/
directory.
It can also be generated from the specified file, run yarn run generate-bytecode [tokens.json path] [bytecodes.json output path]
The token list for ERC20 smart contracts is in ./resources/example_tokens.json
. Name, symbol and Currency ID bytes are needed for each token, for instance:
{
"name": "ACA",
"symbol": "ACA",
"currencyId": "0x0000"
}
These ERC20 contracts make native and cross-chain tokens available inside Acala EVM.
ACA contract address: 0x0000000000000000000000000000000001000000
.
AUSD contract address: 0x0000000000000000000000000000000001000001
.
DOT contract address: 0x0000000000000000000000000000000001000002
.
LDOT contract address: 0x0000000000000000000000000000000001000003
.
XBTC contract address: 0x0000000000000000000000000000000001000004
.
RENBTC contract address: 0x0000000000000000000000000000000001000005
.
POLKABTC contract address: 0x0000000000000000000000000000000001000006
.
PLM contract address: 0x0000000000000000000000000000000001000007
.
PHA contract address: 0x0000000000000000000000000000000001000008
.
KAR contract address: 0x0000000000000000000000000000000001000080
.
KUSD contract address: 0x0000000000000000000000000000000001000081
.
KSM contract address: 0x0000000000000000000000000000000001000082
.
LKSM contract address: 0x0000000000000000000000000000000001000083
.
SDN contract address: 0x0000000000000000000000000000000001000087
.
// Returns the currencyId of the token.
function currencyId() public view returns (uint256);
// Returns the name of the token.
function name() public view returns (string memory);
// Returns the symbol of the token, usually a shorter version of the name.
function symbol() public view returns (string memory);
// Returns the number of decimals used to get its user representation.
function decimals() public view returns (uint8);
// Returns the amount of tokens in existence.
function totalSupply() public view returns (uint256);
// Returns the amount of tokens owned by `account`.
function balanceOf(address account) public view returns (uint256);
// Moves `amount` tokens from the caller's account to `recipient`.
// Returns a boolean value indicating whether the operation succeeded.
// Emits a {Transfer} event.
function transfer(address recipient, uint256 amount) public returns (bool);
// Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}.
// This is zero by default.
function allowance(address owner, address spender) public view returns (uint256);
// Sets `amount` as the allowance of `spender` over the caller's tokens.
// Returns a boolean value indicating whether the operation succeeded.
function approve(address spender, uint256 amount) public returns (bool);
// Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance.
// Returns a boolean value indicating whether the operation succeeded.
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool);
// Atomically increases the allowance granted to `spender` by the caller.
// This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}.
// Emits an {Approval} event indicating the updated allowance.
function increaseAllowance(address spender, uint256 addedValue) public returns (bool);
// Atomically decreases the allowance granted to `spender` by the caller.
// This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}.
// Emits an {Approval} event indicating the updated allowance.
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool);
These contracts make other chain-native functionalities available in Acala EVM.
0x0000000000000000000000000000000000000800
// Returns the const of NewContractExtraBytes.
function newContractExtraBytes() public view returns (uint256);
// Returns the const of StorageDepositPerByte.
function storageDepositPerByte() public view returns (uint256);
// Returns the maintainer of the contract.
function maintainerOf(address contract_address) public view returns (address);
// Returns the const of DeveloperDeposit.
function developerDeposit() public view returns (uint256);
// Returns the const of DeploymentFee.
function deploymentFee() public view returns (uint256);
// Transfer the maintainer of the contract.
// Returns a boolean value indicating whether the operation succeeded.
function transferMaintainer(address contract_address, address new_maintainer) public returns (bool);
0x0000000000000000000000000000000000000801
// Get the price of the currency_id.
// Returns the (price, timestamp)
function getPrice(address token) public view returns (uint256, uint256);
0x0000000000000000000000000000000000000802
// Schedule call the contract.
// Returns a boolean value indicating whether the operation succeeded.
function scheduleCall(address contract_address, uint256 value, uint256 gas_limit, uint256 storage_limit, uint256 min_delay, bytes memory input_data) public returns (bool);
// Cancel schedule call the contract.
// Returns a boolean value indicating whether the operation succeeded.
function cancelCall(bytes memory task_id) public returns (bool);
// Reschedule call the contract.
// Returns a boolean value indicating whether the operation succeeded.
function rescheduleCall(uint256 min_delay, bytes memory task_id) public returns (bool);
0x0000000000000000000000000000000000000803
// Get liquidity of the currency_id_a and currency_id_b.
// Returns (liquidity_a, liquidity_b)
function getLiquidity(address tokenA, address tokenB) public view returns (uint256, uint256)
// Swap with exact supply.
// Returns (target_amount)
function swapWithExactSupply(address tokenA, address tokenB, uint256 supplyAmount, uint256 minTargetAmount) public view returns (uint256)
These contracts will make Acala's DeFi primitives (stablecoin, staking derivative, and DeX) available in Acala EVM.
FAQs
AcalaNetwork Smart Contract library for Solidity
The npm package @acala-network/contracts receives a total of 585 weekly downloads. As such, @acala-network/contracts popularity was classified as not popular.
We found that @acala-network/contracts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.