
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@axelar-network/axelar-cgp-solidity
Advanced tools
Axelar is a decentralized interoperability network connecting all blockchains, assets and apps through a universal set of protocols and APIs. It is built on top off the Cosmos SDK. Users/Applications can use Axelar network to send tokens between any Cosmos and EVM chains. They can also send arbitrary messages between EVM chains.
Axelar network's decentralized validators confirm events emitted on EVM chains (such as deposit confirmation and message send), and sign off on commands submitted (by automated services) to the gateway smart contracts (such as minting token, and approving message on the destination).
npm ci
npm run build
# Might need
# npm install mocha -g
npm run test # Test with mocha
A
is deployed (AxelarGatewayMultisig.deployToken()
)
on each non-native EVM chain as an ERC-20 token (BurnableMintableCappedERC20.sol
).DepositHandler.sol
is deployed,
BurnableMintableCappedERC20.depositAddress()
) on source EVM chain.A
at that address, and the deposit contract locks the token at the gateway (or burns them for wrapped tokens).Transfer
event using their RPC nodes for the source chain (using majority voting).AxelarGatewayMultisig.execute()
.mint
's the specified amount of the wrapped Token A
to the destination address.IAxelarExecutable.sol
interface to receive the message.ERC20.approve()
beforehand to allow the gateway contract
to transfer the specified amount
on behalf of the sender/source contract.AxelarGateway.callContractWithToken()
with the destination chain/address, payload
and token.payload
in a regular database, keyed by the hash(payload)
, that anyone can query by.ContractCallWithToken
event.AxelarGatewayMultisig.approveContractCallWithMint()
command, signed by the validators.payload hash
and emits the event ContractCallApprovedWithMint
.IAxelarExecutable.executeWithToken()
on the destination contract, with the payload
and other data as params.executeWithToken
of the destination contract verifies that the contract call was indeed approved by calling AxelarGateway.validateContractCallAndMint()
on the gateway contract.payload
for it's own application.See this example cross-chain NFT application.
AxelarGatewayMultisig.execute()
takes a signed batched of commands.
Each command has a corresponding commandID
. This is guaranteed to be unique from the Axelar network. execute
intentionally allows retrying
a commandID
if the command
failed to be processed; this is because commands are state dependent, and someone might submit command 2 before command 1 causing it to fail.External
: An external ERC-20 token on it's native chain is registered as external, e.g. USDC
on Ethereum.InternalBurnableFrom
: Axelar wrapped tokens that are minted by the Axelar network when transferring over the original token, e.g. axlATOM
, axlUSDC
on Avalanche.InternalBurnable
: v1.0.0
version of Axelar wrapped tokens that used a different deposit address contract, e.g. UST
(native to Terra) on Avalanche.
New tokens cannot be of this type, and this is only present for legacy support.TokenDeployer
contract.AxelarGatewayMultisig
contract with the token deployer address.AxelarGatewayProxy
contract with the implementation contract address (from above) and setup
params obtained from the current network state.This interface needs to be implemented by the application contract to receive cross-chain messages. See the token swapper example for an example.
Our gateway contracts implement the proxy pattern to allow upgrades.
Calls are delegated to the implementation contract while using the proxy's storage. setup
is overidden to be an empty method on the proxy contract to prevent anyone besides the proxy contract from calling the implementation's setup
on the proxy storage.
Implementation contract with shared functionality between the multisig and singlesig contract versions.
The implementation contract that accepts commands signed by Axelar network's validators (see execute
).
Different commands require different sets of validators to sign (operators vs owners).
Operators correspond to a smaller subset of Axelar validators, whereas owners are chosen by stake and represent a larger subset.
Multisig governance contract. Upgrading the implementation is done via voting on the new implementation address from admin accounts.
Base ERC20 contract used to deploy wrapped version of tokens on other chains.
Allow an account to issue a spending permit to another account.
Mintable ERC20 token contract with an optional capped total supply (when capacity != 0
).
It also allows us the owner of the ERC20 contract to burn tokens for an account (IERC20BurnFrom
).
The main token contract that's deployed for Axelar wrapped version of tokens on non-native chains.
This contract allows burning tokens from deposit addresses generated (depositAddress
) by the Axelar network, where
users send their deposits. salt
needed to generate the address is provided in a signed burn command
from the Axelar network validators.
When the Axelar network submits a signed command to deploy a token,
the token deployer contract is called to deploy the BurnableMintableCappedERC20
token.
This is done to reduce the bytecode size of the gateway contract to allow deploying on EVM chains
with more restrictive gas limits.
The contract deployed at the deposit addresses that allows burning/locking of the tokens
sent by the user. It prevents re-entrancy, and while it's methods are permisionless,
the gateway deploys the deposit handler and burns/locks in the same call (see _burnToken
).
Safe interface contract.
Define ownership of a contract and modifiers for permissioned methods.
Storage contract for the proxy.
Modified version of OpenZeppelin ECDSA signature authentication check.
Network resources: https://docs.axelar.dev/resources
Token transfer app: https://satellite.axelar.network/
General Message Passing Usage: https://docs.axelar.dev/dev/gmp
Example token transfer flow: https://docs.axelar.dev/dev/cli/axl-to-evm
Deployed contracts: https://docs.axelar.dev/resources/mainnet
EVM module of the Axelar network that prepares commands for the gateway: https://github.com/axelarnetwork/axelar-core/blob/main/x/evm/keeper/msg_server.go
FAQs
EVM Smart Contracts for Axelar Network
The npm package @axelar-network/axelar-cgp-solidity receives a total of 267,055 weekly downloads. As such, @axelar-network/axelar-cgp-solidity popularity was classified as popular.
We found that @axelar-network/axelar-cgp-solidity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.