Skip to content

Instantly share code, notes, and snippets.

View MatheeshaMe's full-sized avatar
🏠
Working from home

Matheesha MatheeshaMe

🏠
Working from home
View GitHub Profile
@MatheeshaMe
MatheeshaMe / zkp-trad2.0-auth-comp.md
Last active March 2, 2025 06:54
zkp-trad2.0-auth-comp

1. Security

Aspect Traditional ZKP
Credential Exposure Password sent over wire (HTTPS mitigates). Secret never leaves client—proofs only.
Server Breach Hashed passwords stolen → Offline cracking (bcrypt slows this). Stored hash stolen → Useless without secret (preimage resistance).
Replay Attacks Mitigated by tokens expiring or nonces in OAuth. Nonce per proof—replay blocked.
MITM HTTPS protects; plaintext password risk if TLS fails. HTTPS still needed; proofs leak less info.
Trusted Setup None—simple crypto (SHA, bcrypt). ZK-SNARKs need trusted setup—leak risks forgery.
@MatheeshaMe
MatheeshaMe / Contract.sol
Last active January 25, 2024 13:05
EIP2535 PROXY Upkeepers + VRF Automation
// ChainLink Upkeeper Before call the drawRandomNumbers() in performUpkeep: https://automation.chain.link/sepolia/115547471504265190820073408386005706024884462340762188193737203657165225971911
// the VRF subscription that only can call drawRandomNumbers() get response when its call from this contract, Not from the diamond : https://vrf.chain.link/sepolia/8857
// Full Code Of the contract : 0x44d2bec3a28fa0524a8e65cfe739f7f25dc0a8ea
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import {CalculateWinners} from "./libraries/CalculateWinners.sol";
@MatheeshaMe
MatheeshaMe / callbackGasLimitError.sol
Created January 25, 2024 06:31
ERROR : Callback gas limit set too low txHash Sepolia - 0xddf4749a5a915983a95210a7f7dc5b78a73ff0e3591c07acd0044a75942cbdc8
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
contract VRF2 {
event VrfRandomNumber(uint256 randomNumber, uint256 _vrfTimeSet);
uint256 public lastRN;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
interface ILink {
function allowance(address owner, address spender)
external
view
returns (uint256 remaining);
function approve(address spender, uint256 value)
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "https://github.com/immutable/imx-contracts/blob/main/contracts/IMintable.sol";
import "https://github.com/immutable/imx-contracts/blob/main/contracts/utils/Minting.sol";
abstract contract Mintable is Ownable, IMintable {
address public imx;
mapping(uint256 => bytes) public blueprints;