Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/contracts/constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ uint256 constant TO_HIT_MODIFIER = 150_000;
uint256 constant DEFENSE_MODIFIER = 100_000;
uint256 constant ATTACK_MODIFIER = 100_000;
uint256 constant CRIT_MODIFIER = 2;

//Gold Drop constants
uint256 constant BASE_GOLD_DROP = 1e15; //
7 changes: 2 additions & 5 deletions packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ allow_paths = [
# projects created from this template and using linked mud packages
"../../../mud/packages",
]
extra_output_files = [
"abi",
"evm.bytecode"
]
fs_permissions = [{ access = "read", path = "./"}]
extra_output_files = ["abi", "evm.bytecode"]
fs_permissions = [{ access = "read-write", path = "./" }]
libs = ["node_modules", "lib"]

[profile.base-sepolia]
Expand Down
39 changes: 34 additions & 5 deletions packages/contracts/items.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
{
"armor": [
{
"dropChance": 20000000,
"initialSupply": 10000000000000000000,
"metadataUri": "1_rags.json",
"name": "Rags",
"stats": {
"agiModifier": 0,
"armorModifier": 1,
"classRestrictions": [],
"hitPointModifier": 0,
"intModifier": 0,
"minLevel": 0,
"strModifier": 0
}
}
],
"metadataUriPrefix": "ipfs://QmVUaqRpQJHyqugYd12Qf2iErNSoGvLF1cbeRHpmX8bChs/",
"items": [
"weapons": [
{
"dropChance": 20000000,
"initialSupply": 10000000000000000000,
"metadataUri": "1_rusty_sword.json",
"name": "Rusty Sword",
"stats": {
"agiModifier": 4,
"classRestrictions": [],
"classRestrictions": [
0
],
"hitPointModifier": 6,
"intModifier": 5,
"maxDamage": 2,
Expand All @@ -16,11 +37,15 @@
}
},
{
"dropChance": 20000000,
"initialSupply": 10000000000000000000,
"metadataUri": "2_cracked_dagger.json",
"name": "Cracked Dagger",
"stats": {
"agiModifier": 4,
"classRestrictions": [],
"classRestrictions": [
1
],
"hitPointModifier": 6,
"intModifier": 5,
"maxDamage": 2,
Expand All @@ -30,11 +55,15 @@
}
},
{
"dropChance": 20000000,
"initialSupply": 10000000000000000000,
"metadataUri": "3_cobbled_wand.json",
"name": "Cobbled Wand",
"stats": {
"agiModifier": 4,
"classRestrictions": [],
"classRestrictions": [
2
],
"hitPointModifier": 6,
"intModifier": 5,
"maxDamage": 2,
Expand All @@ -44,4 +73,4 @@
}
}
]
}
}
2 changes: 2 additions & 0 deletions packages/contracts/mud.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ export default defineWorld({
schema: {
itemId: "uint256",
itemType: "ItemType",
dropChance: "uint256",
stats: "bytes",
// probability in 10^6 e.g. 20_000_000 = 20%
},
key: ["itemId"],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
{
"type": "function",
"name": "getCurrentLevel",
"name": "getCurrentAvailableLevel",
"inputs": [
{
"name": "experience",
Expand Down Expand Up @@ -283,6 +283,30 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "isValidOwner",
"inputs": [
{
"name": "characterId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "owner",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "mintCharacter",
Expand Down Expand Up @@ -372,6 +396,43 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "event",
"name": "Store_SetRecord",
"inputs": [
{
"name": "tableId",
"type": "bytes32",
"indexed": true,
"internalType": "ResourceId"
},
{
"name": "keyTuple",
"type": "bytes32[]",
"indexed": false,
"internalType": "bytes32[]"
},
{
"name": "staticData",
"type": "bytes",
"indexed": false,
"internalType": "bytes"
},
{
"name": "encodedLengths",
"type": "bytes32",
"indexed": false,
"internalType": "EncodedLengths"
},
{
"name": "dynamicData",
"type": "bytes",
"indexed": false,
"internalType": "bytes"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Store_SpliceDynamicData",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ declare const abi: [
},
{
"type": "function",
"name": "getCurrentLevel",
"name": "getCurrentAvailableLevel",
"inputs": [
{
"name": "experience",
Expand Down Expand Up @@ -283,6 +283,30 @@ declare const abi: [
],
"stateMutability": "view"
},
{
"type": "function",
"name": "isValidOwner",
"inputs": [
{
"name": "characterId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "owner",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "mintCharacter",
Expand Down Expand Up @@ -372,6 +396,43 @@ declare const abi: [
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "event",
"name": "Store_SetRecord",
"inputs": [
{
"name": "tableId",
"type": "bytes32",
"indexed": true,
"internalType": "ResourceId"
},
{
"name": "keyTuple",
"type": "bytes32[]",
"indexed": false,
"internalType": "bytes32[]"
},
{
"name": "staticData",
"type": "bytes",
"indexed": false,
"internalType": "bytes"
},
{
"name": "encodedLengths",
"type": "bytes32",
"indexed": false,
"internalType": "EncodedLengths"
},
{
"name": "dynamicData",
"type": "bytes",
"indexed": false,
"internalType": "bytes"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Store_SpliceDynamicData",
Expand Down

Large diffs are not rendered by default.

Loading