Full build: Vite/React acid-terminal frontend (BEARER design system, Panchang/Sentient/Fragment Mono, neon layer, palette audit script), HoodquidityVaults Foundry contracts (single+dual deposits via Chainlink-style feeds, hybrid exit, 10% platform fee, boost, Genesis LP), Reown AppKit wallet connect with Robinhood Chain testnet (46630), live data from Dexscreener and onchain reads, partner portal, design-sync setup for claude.ai/design. Deploy: static via Forgejo Actions platform, BUILD_DIR=apps/web/dist (.env). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
36 lines
1.1 KiB
Solidity
36 lines
1.1 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.8.20;
|
|
|
|
import {Test} from "forge-std/Test.sol";
|
|
import {Base64} from "@openzeppelin/contracts/utils/Base64.sol";
|
|
|
|
contract Base64Test is Test {
|
|
function testEncode(bytes memory input) external pure {
|
|
assertEq(Base64.encode(input), vm.toBase64(input));
|
|
assertEq(Base64.decode(Base64.encode(input)), input);
|
|
}
|
|
|
|
function testEncodeURL(bytes memory input) external pure {
|
|
assertEq(Base64.encodeURL(input), _removePadding(vm.toBase64URL(input)));
|
|
assertEq(Base64.decode(Base64.encodeURL(input)), input);
|
|
}
|
|
|
|
function _removePadding(string memory inputStr) internal pure returns (string memory) {
|
|
bytes memory input = bytes(inputStr);
|
|
bytes memory output;
|
|
|
|
for (uint256 i = 0; i < input.length; ++i) {
|
|
if (input[input.length - i - 1] != 0x3d) {
|
|
output = new bytes(input.length - i);
|
|
break;
|
|
}
|
|
}
|
|
|
|
for (uint256 i = 0; i < output.length; ++i) {
|
|
output[i] = input[i];
|
|
}
|
|
|
|
return string(output);
|
|
}
|
|
}
|