Skip to content

Instantly share code, notes, and snippets.

View Meharab's full-sized avatar
🔥
💥 Cold ❄ Blooded 🩸 Coder 💻

Meharab G Meharab

🔥
💥 Cold ❄ Blooded 🩸 Coder 💻
View GitHub Profile
@Meharab
Meharab / ERC721.sol
Created February 22, 2024 11:25
ERC721 Transfer in Solidity
function transferFrom(address from, address to, uint256 tokenId) public {
require(ownerOf(tokenId) == from, "NFT not owned by sender");
// ... (rest of transfer logic)
}
@Meharab
Meharab / SIP11.clar
Created February 22, 2024 11:24
ERC721 Transfer in Clarity
(define-fun transfer (to addr token-id)
(if (= (owner token-id) msg-sender)
(do
(let ((new-owner to))
(set-owner token-id new-owner))
(fail "not-owner")))
@Meharab
Meharab / Problem.md
Last active July 16, 2023 12:38
Axiom Open-Source Program ZK Puzzle

Problem Details

This puzzle is to write a Circom circuit constraining filtering from an array of tuples.

  • The objective is to minimize the non-linear constraint count.
  • You can test your solution at: https://zkrepl.dev/
  • Submit your solution in the form of:
    1. a link to a circuit on zkRepl saved as a Github Gist
    2. a writeup explaining your approach You should fill in the following template:
import Hello from "./d3hello.cdc"
pub fun main(name: String): String {
return Hello.sayHi(to: name)
}
pub contract Hello {
pub event IssuedGreeting(greeting: String)
pub fun sayHi(to name: String): String {
let greeting = "Hi, ".concat(name)
//emit IssuedGreeting(greeting: greeting)
return greeting
}
{
"emulators": {
"default": {
"port": 3569,
"serviceAccount": "emulator-account"
}
},
"contracts": {
"Hello": "./smart-contract/d3hello.cdc"
},
pub struct Rectangle {
pub let width: Int
pub let height: Int
init(width: Int, height: Int) {
self.width = width
self.height = height
}
}
@Meharab
Meharab / Auction.sol
Created May 7, 2020 19:06
smart contract for auction
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}
@Meharab
Meharab / data-preprocessing-template.ipynb
Created April 19, 2020 16:49
Data Preprocessing Template.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Meharab
Meharab / classification-template.ipynb
Created April 19, 2020 15:40
Classification Template.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.