Skip to content

Instantly share code, notes, and snippets.

@calnix
calnix / MocaPoints.sol
Created January 24, 2024 06:57
MocaPoints
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import {IRealmId} from "./interface/IRealmId.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {AccessControlStorage} from "@animoca/ethereum-contracts/contracts/access/libraries/AccessControlStorage.sol";
import {AccessControlBase} from "@animoca/ethereum-contracts/contracts/access/base/AccessControlBase.sol";
import {ContractOwnershipBase} from "@animoca/ethereum-contracts/contracts/access/base/ContractOwnershipBase.sol";
import {ContractOwnershipStorage} from "@animoca/ethereum-contracts/contracts/access/libraries/ContractOwnershipStorage.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
@calnix
calnix / StakingPool.md
Created January 24, 2024 03:22
Staking Pool

PoolManager

        -----> PoolA

        -----> PoolB
        
        -----> PoolC -----> VaultA
                     -----> VaultB

PoolManager

@calnix
calnix / look4.sol
Created December 4, 2023 06:39
eip-712 - what?
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import {IERC721} from "openzeppelin-contracts/contracts/token/ERC721/IERC721.sol";
contract Question4 {
bytes32 public domainSeparator;
struct SellOrder {
address signer;
# Problem 1
out = 5*x**3 - 4*y**2*x**2 + 13*x*y**2 + x**2 - 10*y
out - 5*x**3 + 4*y**2*x**2 + 10y - x**2 = 13*x*y**2
out - 5v3 + 4v4 + 10y - v1 = - 13x*v2
## Constraints
(x**2): v1 = x * x
(y**2): v2 = y * y
(x**3): v3 = v1 * x
@calnix
calnix / ecPairing.sol
Last active November 7, 2023 10:13
ecPairing - hw4
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
contract HW4 {
struct ECPoint {
uint256 X;
uint256 Y;
}
import secrets
import hashlib
import hmac
import sys
# y^2 = x^3 + ax + b mod p
class EllipticCurve():
def __init__(self, a, b, p, x, y):
# coeff. and modulus
self.a = a
@calnix
calnix / Readme.md
Created September 6, 2022 02:17 — forked from Sebb767/Readme.md
Escape The Matrix (Dark Web Article)

This is the famous escape the matrix article from the hidden wiki. Since most mirrors are down and on the hidden wiki itself, the first chaper was replaced with a bitcoin scam, I thought I repost this here. Copyright goes to the original author and I'm not stating any opinion on this text except that it may or may not be an interesting read ;)

The .txt version is taken from here (there's also an intepretation where that came from), the markdown version was converted via some regexes by, well, me.

Have fun :)