Remove outdated GPU marketplace endpoint and fix staking service logic
- Remove duplicate `/marketplace/gpu/{gpu_id}` endpoint from marketplace_gpu.py
- Remove marketplace_gpu router inclusion from main.py (already included elsewhere)
- Fix staking service staker_count logic to check existing stakes before increment/decrement
- Add minimum stake amount validation (100 AITBC)
- Add proper error handling for stake not found cases
- Fix staking pool update to commit and refresh after modifications
- Update CLI send_transaction to use chain
This commit is contained in:
@@ -0,0 +1,163 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "CrossChainReputation",
|
||||
"sourceName": "contracts/CrossChainReputation.sol",
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "previousOwner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnershipTransferred",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "agent",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "newScore",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "ReputationUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_agent",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getReputation",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "renounceOwnership",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "reputations",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "score",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "taskCompleted",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "disputeLost",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "lastUpdated",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferOwnership",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_agent",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_score",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_tasks",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_disputes",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "updateReputation",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x6080806040523461005b5760008054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36103af90816100618239f35b600080fdfe60806040818152600436101561001457600080fd5b600091823560e01c90816306fa15a7146102ac57508063715018a61461024f5780638da5cb5b146102285780639c89a0e2146101f1578063ea1a2b69146101275763f2fde38b1461006457600080fd5b346101235760203660031901126101235761007d610306565b610085610321565b6001600160a01b039081169182156100d1575082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b5162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b5080fd5b503461012357608036600319011261012357610141610306565b906024359061014e610321565b80516080810181811067ffffffffffffffff8211176101dd57917ffc577563f1b9a0461e24abef1e1fcc0d33d3d881f20b5df6dda59de4aae2c8219391602093825282815260038482019660443588528383016064358152606084019142835260018060a01b031698898b5260018852858b20945185555160018501555160028401555191015551908152a280f35b634e487b7160e01b86526041600452602486fd5b50346101235760203660031901126101235760209181906001600160a01b03610218610306565b1681526001845220549051908152f35b5034610123578160031936011261012357905490516001600160a01b039091168152602090f35b82346102a957806003193601126102a957610268610321565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b919050346103025760203660031901126103025760809281906001600160a01b036102d5610306565b16815260016020522080549160018201546003600284015493015493855260208501528301526060820152f35b8280fd5b600435906001600160a01b038216820361031c57565b600080fd5b6000546001600160a01b0316330361033557565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea264697066735822122041e640d9444aa6c5248b76003e9bd1dec503f00e2aa60e5699fa4a8e8e74e86e64736f6c63430008130033",
|
||||
"deployedBytecode": "0x60806040818152600436101561001457600080fd5b600091823560e01c90816306fa15a7146102ac57508063715018a61461024f5780638da5cb5b146102285780639c89a0e2146101f1578063ea1a2b69146101275763f2fde38b1461006457600080fd5b346101235760203660031901126101235761007d610306565b610085610321565b6001600160a01b039081169182156100d1575082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b5162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b5080fd5b503461012357608036600319011261012357610141610306565b906024359061014e610321565b80516080810181811067ffffffffffffffff8211176101dd57917ffc577563f1b9a0461e24abef1e1fcc0d33d3d881f20b5df6dda59de4aae2c8219391602093825282815260038482019660443588528383016064358152606084019142835260018060a01b031698898b5260018852858b20945185555160018501555160028401555191015551908152a280f35b634e487b7160e01b86526041600452602486fd5b50346101235760203660031901126101235760209181906001600160a01b03610218610306565b1681526001845220549051908152f35b5034610123578160031936011261012357905490516001600160a01b039091168152602090f35b82346102a957806003193601126102a957610268610321565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b919050346103025760203660031901126103025760809281906001600160a01b036102d5610306565b16815260016020522080549160018201546003600284015493015493855260208501528301526060820152f35b8280fd5b600435906001600160a01b038216820361031c57565b600080fd5b6000546001600160a01b0316330361033557565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea264697066735822122041e640d9444aa6c5248b76003e9bd1dec503f00e2aa60e5699fa4a8e8e74e86e64736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
Reference in New Issue
Block a user