Loading...
Loading...
Deploy contracts to SKALE chains. Covers chain selection, RNG, bridge, deployment setup. Use for deploying smart contracts to SKALE.
npx skill4agent add skalenetwork/skills deploy-to-skale| Network | Chain ID | RPC | Explorer |
|---|---|---|---|
| Testnet | 324705682 | | |
| Mainnet | 1187947933 | | |
| Chain | Chain ID | RPC | Explorer |
|---|---|---|---|
| Europa Hub | 2046399126 | | |
| Calypso Hub | 1564830818 | | |
| Nebula Hub | 1482601649 | | |
# Install Foundry if needed
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Install SKALE RNG library
forge install dirtroad/skale-rng
# Deploy
forge script script/Deploy.s.sol \
--rpc-url $SKALE_RPC \
--private-key $PRIVATE_KEY \
--legacy \
--broadcast// hardhat.config.ts
const config: HardhatUserConfig = {
networks: {
skaleBaseSepolia: {
url: process.env.SKALE_RPC,
chainId: 324705682,
accounts: [process.env.PRIVATE_KEY]
},
skaleBase: {
url: process.env.SKALE_RPC,
chainId: 1187947933,
accounts: [process.env.PRIVATE_KEY]
}
},
solidity: { version: "0.8.27" }
};
export default config;npx hardhat run scripts/deploy.ts --network skaleBaseSepolia# foundry.toml
solc_version = "0.8.27"
evm_version = "istanbul"0x18import "@dirtroad/skale-rng/contracts/RNG.sol";
contract MyContract is RNG {
function random() external view returns (uint256) {
return getRandomNumber();
}
function randomRange(uint256 min, uint256 max) external view returns (uint256) {
return getNextRandomRange(min, max);
}
}const token = new Contract(tokenAddress, ERC20_ABI, signer);
const bridge = new Contract(bridgeAddress, BRIDGE_ABI, signer);
await token.approve(bridgeAddress, amount);
await bridge.depositERC20(tokenAddress, amount, targetChain, receiver);0xd2AAa00100000000000000000000000000000000x402-on-skalenpm install @x402/core @x402/evm @x402/honoimport { paymentMiddleware, x402ResourceServer } from "@x402/hono";
import { HTTPFacilitatorClient } from "@x402/core/server";
const client = new HTTPFacilitatorClient({ url: "https://facilitator.payai.network" });
const server = new x402ResourceServer(client);
app.use(paymentMiddleware({
"GET /api/premium": {
accepts: [{
scheme: "exact",
network: "eip155:324705682",
payTo: "0xYourAddress",
price: {
amount: "10000",
asset: "0x2e08028E3C4c2356572E096d8EF835cD5C6030bD"
}
}]
}
}, server));0x2e08028E3C4c2356572E096d8EF835cD5C6030bD0x61a26022927096f444994dA1e53F0FD9487EAfcfbuild-with-bite