This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use core::option::OptionTrait; | |
use core::traits::TryInto; | |
use core::array::ArrayTrait; | |
use core::traits::Into; | |
use core::fmt::{Display, Formatter, Error}; | |
fn mul(x: u16, y: u16) -> u32 { | |
let z: u32 = x.into() * y.into(); | |
z | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use starknet::ContractAddress; | |
#[starknet::interface] | |
trait IRoom<TContractState> { | |
fn register(ref self: TContractState,) -> bool; | |
fn join_room(ref self: TContractState, id: u8) -> bool; | |
fn create_room( | |
ref self: TContractState, title: felt252, description: felt252, members: u16 | |
) -> Room::Room; | |
fn get_room_details(self: @TContractState, id: u8) -> Room::Room; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod todo; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{error::Error, hash::{DefaultHasher, Hash, Hasher}}; | |
trait Auction { | |
fn commit(a: u8, b: u8) -> Result<Vec<u8>, Box<dyn Error>>; | |
fn open(input: u8, commitment: Vec<u8>) -> Result<bool, Box<dyn Error>>; | |
} | |
struct Auctioning {} | |
impl Auctioning { | |
fn to_hash(value: u8) -> Vec<u8> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
///@author Faith M. Roberts | |
// Write a contract that deposit fund into a contract. | |
// And also keep track of funds transferred into the contract. | |
// Add a function to the balance of address that have deposited into the contract. | |
//FALLBACKS | |
//The fallback function is executed if none of the other functions matches the function identifier or no data was provided with the function call. | |
pragma solidity ^0.8.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
///@author Faith M. Roberts | |
///@title Student Records | |
contract Records{ | |
address public admin_address; | |
struct StudentsInfo{ | |
string name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
pragma experimental ABIEncoderV2; | |
/// @author Faith M. Roberts | |
/// @title A Simple Decentralized Domain Naming Service Contract. | |
contract Faytey7Dns { | |
address public owner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
/// @author Faith M. Roberts | |
/// @title A Simple Decentralized Domain Naming Service Contract. | |
contract Faytey7Dns { | |
address public owner; |