diff --git a/addresses.json b/addresses.json index 7267fc6..99624bb 100644 --- a/addresses.json +++ b/addresses.json @@ -174,7 +174,7 @@ }, { "symbol": "BONSAI", - "addy": "0x9f98f838e3db42830ef488a92c8ed9671268000e" + "addy": "0x2549f9Bbccdc5a65DDCeA45eF91dC9BdE30697c2" } ], "Modules": { diff --git a/broadcast/DeployMockCurrency.s.sol/80002/9352fad2-latest.json b/broadcast/DeployMockCurrency.s.sol/80002/9352fad2-latest.json new file mode 100644 index 0000000..8d92abb --- /dev/null +++ b/broadcast/DeployMockCurrency.s.sol/80002/9352fad2-latest.json @@ -0,0 +1,66 @@ +{ + "transactions": [ + { + "hash": "0x34cf86f665075916ada9af7b983548bbc1e8ad38a0925060ac9dbf643be3b718", + "transactionType": "CREATE", + "contractName": "MockCurrency", + "contractAddress": "0x2549f9bbccdc5a65ddcea45ef91dc9bde30697c2", + "function": null, + "arguments": [ + "\"Bonsai\"", + "\"BONSAI\"" + ], + "transaction": { + "from": "0xed4ae5eb2a93658852343385a0b28a2b66a07697", + "gas": "0xc41dc", + "value": "0x0", + "input": "0x60806040523480156200001157600080fd5b5060405162000c2338038062000c23833981016040819052620000349162000123565b818160036200004483826200021c565b5060046200005382826200021c565b5050505050620002e8565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200008657600080fd5b81516001600160401b0380821115620000a357620000a36200005e565b604051601f8301601f19908116603f01168101908282118183101715620000ce57620000ce6200005e565b81604052838152602092508683858801011115620000eb57600080fd5b600091505b838210156200010f5785820183015181830184015290820190620000f0565b600093810190920192909252949350505050565b600080604083850312156200013757600080fd5b82516001600160401b03808211156200014f57600080fd5b6200015d8683870162000074565b935060208501519150808211156200017457600080fd5b50620001838582860162000074565b9150509250929050565b600181811c90821680620001a257607f821691505b602082108103620001c357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021757600081815260208120601f850160051c81016020861015620001f25750805b601f850160051c820191505b818110156200021357828155600101620001fe565b5050505b505050565b81516001600160401b038111156200023857620002386200005e565b62000250816200024984546200018d565b84620001c9565b602080601f8311600181146200028857600084156200026f5750858301515b600019600386901b1c1916600185901b17855562000213565b600085815260208120601f198616915b82811015620002b95788860151825594840194600190910190840162000298565b5085821015620002d85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61092b80620002f86000396000f3fe608060405234801561001057600080fd5b50600436106100a45760003560e01c806306fdde03146100a9578063095ea7b3146100c757806318160ddd146100ea57806323b872dd146100fc578063313ce5671461010f578063395093511461011e57806340c10f191461013157806370a082311461014657806395d89b411461016f578063a457c2d714610177578063a9059cbb1461018a578063dd62ed3e1461019d575b600080fd5b6100b16101b0565b6040516100be9190610755565b60405180910390f35b6100da6100d53660046107bf565b610242565b60405190151581526020016100be565b6002545b6040519081526020016100be565b6100da61010a3660046107e9565b61025c565b604051601281526020016100be565b6100da61012c3660046107bf565b610280565b61014461013f3660046107bf565b6102a2565b005b6100ee610154366004610825565b6001600160a01b031660009081526020819052604090205490565b6100b16102b0565b6100da6101853660046107bf565b6102bf565b6100da6101983660046107bf565b61033f565b6100ee6101ab366004610847565b61034d565b6060600380546101bf9061087a565b80601f01602080910402602001604051908101604052809291908181526020018280546101eb9061087a565b80156102385780601f1061020d57610100808354040283529160200191610238565b820191906000526020600020905b81548152906001019060200180831161021b57829003601f168201915b5050505050905090565b600033610250818585610378565b60019150505b92915050565b60003361026a85828561049c565b610275858585610516565b506001949350505050565b600033610250818585610293838361034d565b61029d91906108b4565b610378565b6102ac82826106a8565b5050565b6060600480546101bf9061087a565b600033816102cd828661034d565b9050838110156103325760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6102758286868403610378565b600033610250818585610516565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103da5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610329565b6001600160a01b03821661043b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610329565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006104a8848461034d565b9050600019811461051057818110156105035760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610329565b6105108484848403610378565b50505050565b6001600160a01b03831661057a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610329565b6001600160a01b0382166105dc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610329565b6001600160a01b038316600090815260208190526040902054818110156106545760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610329565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290926000805160206108d6833981519152910160405180910390a3610510565b6001600160a01b0382166106fe5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610329565b806002600082825461071091906108b4565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481526000805160206108d6833981519152910160405180910390a35050565b600060208083528351808285015260005b8181101561078257858101830151858201604001528201610766565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b03811681146107ba57600080fd5b919050565b600080604083850312156107d257600080fd5b6107db836107a3565b946020939093013593505050565b6000806000606084860312156107fe57600080fd5b610807846107a3565b9250610815602085016107a3565b9150604084013590509250925092565b60006020828403121561083757600080fd5b610840826107a3565b9392505050565b6000806040838503121561085a57600080fd5b610863836107a3565b9150610871602084016107a3565b90509250929050565b600181811c9082168061088e57607f821691505b6020821081036108ae57634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561025657634e487b7160e01b600052601160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122058f64b2e115386340a0907ec1a7c860cd5414148cba17afc6ebb5b337b7eac1864736f6c63430008150033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000006426f6e73616900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006424f4e5341490000000000000000000000000000000000000000000000000000", + "nonce": "0x9a", + "chainId": "0x13882" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x96e8d", + "logs": [ + { + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000ed4ae5eb2a93658852343385a0b28a2b66a07697", + "0x0000000000000000000000006c095a53250dd250797ff915a716cca690ad8842" + ], + "data": "0x0000000000000000000000000000000000000000000000000041e1713f8dbc000000000000000000000000000000000000000000000000005adffa69e0f2839700000000000000000000000000000000000000000000003914f7e6aadd1d5a010000000000000000000000000000000000000000000000005a9e18f8a164c7970000000000000000000000000000000000000000000000391539c81c1cab1601", + "blockHash": "0xb14f3c7e20c666e123360c97b6403292bb876fdce49fc9c5c053beebf9c95995", + "blockNumber": "0x6d350a", + "transactionHash": "0x34cf86f665075916ada9af7b983548bbc1e8ad38a0925060ac9dbf643be3b718", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000400000000000004000000000000000000000000000000000200000000000000008008000000000000000004000000000000000000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "type": "0x2", + "transactionHash": "0x34cf86f665075916ada9af7b983548bbc1e8ad38a0925060ac9dbf643be3b718", + "transactionIndex": "0x0", + "blockHash": "0xb14f3c7e20c666e123360c97b6403292bb876fdce49fc9c5c053beebf9c95995", + "blockNumber": "0x6d350a", + "gasUsed": "0x96e8d", + "effectiveGasPrice": "0x6fc23ac0f", + "from": "0xed4ae5eb2a93658852343385a0b28a2b66a07697", + "to": null, + "contractAddress": "0x2549f9bbccdc5a65ddcea45ef91dc9bde30697c2" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1715952534, + "chain": 80002, + "commit": "9b17a1c" +} \ No newline at end of file diff --git a/broadcast/DeployMockCurrency.s.sol/80002/run-1715952534.json b/broadcast/DeployMockCurrency.s.sol/80002/run-1715952534.json new file mode 100644 index 0000000..8d92abb --- /dev/null +++ b/broadcast/DeployMockCurrency.s.sol/80002/run-1715952534.json @@ -0,0 +1,66 @@ +{ + "transactions": [ + { + "hash": "0x34cf86f665075916ada9af7b983548bbc1e8ad38a0925060ac9dbf643be3b718", + "transactionType": "CREATE", + "contractName": "MockCurrency", + "contractAddress": "0x2549f9bbccdc5a65ddcea45ef91dc9bde30697c2", + "function": null, + "arguments": [ + "\"Bonsai\"", + "\"BONSAI\"" + ], + "transaction": { + "from": "0xed4ae5eb2a93658852343385a0b28a2b66a07697", + "gas": "0xc41dc", + "value": "0x0", + "input": "0x60806040523480156200001157600080fd5b5060405162000c2338038062000c23833981016040819052620000349162000123565b818160036200004483826200021c565b5060046200005382826200021c565b5050505050620002e8565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200008657600080fd5b81516001600160401b0380821115620000a357620000a36200005e565b604051601f8301601f19908116603f01168101908282118183101715620000ce57620000ce6200005e565b81604052838152602092508683858801011115620000eb57600080fd5b600091505b838210156200010f5785820183015181830184015290820190620000f0565b600093810190920192909252949350505050565b600080604083850312156200013757600080fd5b82516001600160401b03808211156200014f57600080fd5b6200015d8683870162000074565b935060208501519150808211156200017457600080fd5b50620001838582860162000074565b9150509250929050565b600181811c90821680620001a257607f821691505b602082108103620001c357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021757600081815260208120601f850160051c81016020861015620001f25750805b601f850160051c820191505b818110156200021357828155600101620001fe565b5050505b505050565b81516001600160401b038111156200023857620002386200005e565b62000250816200024984546200018d565b84620001c9565b602080601f8311600181146200028857600084156200026f5750858301515b600019600386901b1c1916600185901b17855562000213565b600085815260208120601f198616915b82811015620002b95788860151825594840194600190910190840162000298565b5085821015620002d85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61092b80620002f86000396000f3fe608060405234801561001057600080fd5b50600436106100a45760003560e01c806306fdde03146100a9578063095ea7b3146100c757806318160ddd146100ea57806323b872dd146100fc578063313ce5671461010f578063395093511461011e57806340c10f191461013157806370a082311461014657806395d89b411461016f578063a457c2d714610177578063a9059cbb1461018a578063dd62ed3e1461019d575b600080fd5b6100b16101b0565b6040516100be9190610755565b60405180910390f35b6100da6100d53660046107bf565b610242565b60405190151581526020016100be565b6002545b6040519081526020016100be565b6100da61010a3660046107e9565b61025c565b604051601281526020016100be565b6100da61012c3660046107bf565b610280565b61014461013f3660046107bf565b6102a2565b005b6100ee610154366004610825565b6001600160a01b031660009081526020819052604090205490565b6100b16102b0565b6100da6101853660046107bf565b6102bf565b6100da6101983660046107bf565b61033f565b6100ee6101ab366004610847565b61034d565b6060600380546101bf9061087a565b80601f01602080910402602001604051908101604052809291908181526020018280546101eb9061087a565b80156102385780601f1061020d57610100808354040283529160200191610238565b820191906000526020600020905b81548152906001019060200180831161021b57829003601f168201915b5050505050905090565b600033610250818585610378565b60019150505b92915050565b60003361026a85828561049c565b610275858585610516565b506001949350505050565b600033610250818585610293838361034d565b61029d91906108b4565b610378565b6102ac82826106a8565b5050565b6060600480546101bf9061087a565b600033816102cd828661034d565b9050838110156103325760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6102758286868403610378565b600033610250818585610516565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103da5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610329565b6001600160a01b03821661043b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610329565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006104a8848461034d565b9050600019811461051057818110156105035760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610329565b6105108484848403610378565b50505050565b6001600160a01b03831661057a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610329565b6001600160a01b0382166105dc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610329565b6001600160a01b038316600090815260208190526040902054818110156106545760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610329565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290926000805160206108d6833981519152910160405180910390a3610510565b6001600160a01b0382166106fe5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610329565b806002600082825461071091906108b4565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481526000805160206108d6833981519152910160405180910390a35050565b600060208083528351808285015260005b8181101561078257858101830151858201604001528201610766565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b03811681146107ba57600080fd5b919050565b600080604083850312156107d257600080fd5b6107db836107a3565b946020939093013593505050565b6000806000606084860312156107fe57600080fd5b610807846107a3565b9250610815602085016107a3565b9150604084013590509250925092565b60006020828403121561083757600080fd5b610840826107a3565b9392505050565b6000806040838503121561085a57600080fd5b610863836107a3565b9150610871602084016107a3565b90509250929050565b600181811c9082168061088e57607f821691505b6020821081036108ae57634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561025657634e487b7160e01b600052601160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122058f64b2e115386340a0907ec1a7c860cd5414148cba17afc6ebb5b337b7eac1864736f6c63430008150033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000006426f6e73616900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006424f4e5341490000000000000000000000000000000000000000000000000000", + "nonce": "0x9a", + "chainId": "0x13882" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x96e8d", + "logs": [ + { + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000ed4ae5eb2a93658852343385a0b28a2b66a07697", + "0x0000000000000000000000006c095a53250dd250797ff915a716cca690ad8842" + ], + "data": "0x0000000000000000000000000000000000000000000000000041e1713f8dbc000000000000000000000000000000000000000000000000005adffa69e0f2839700000000000000000000000000000000000000000000003914f7e6aadd1d5a010000000000000000000000000000000000000000000000005a9e18f8a164c7970000000000000000000000000000000000000000000000391539c81c1cab1601", + "blockHash": "0xb14f3c7e20c666e123360c97b6403292bb876fdce49fc9c5c053beebf9c95995", + "blockNumber": "0x6d350a", + "transactionHash": "0x34cf86f665075916ada9af7b983548bbc1e8ad38a0925060ac9dbf643be3b718", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000400000000000004000000000000000000000000000000000200000000000000008008000000000000000004000000000000000000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "type": "0x2", + "transactionHash": "0x34cf86f665075916ada9af7b983548bbc1e8ad38a0925060ac9dbf643be3b718", + "transactionIndex": "0x0", + "blockHash": "0xb14f3c7e20c666e123360c97b6403292bb876fdce49fc9c5c053beebf9c95995", + "blockNumber": "0x6d350a", + "gasUsed": "0x96e8d", + "effectiveGasPrice": "0x6fc23ac0f", + "from": "0xed4ae5eb2a93658852343385a0b28a2b66a07697", + "to": null, + "contractAddress": "0x2549f9bbccdc5a65ddcea45ef91dc9bde30697c2" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1715952534, + "chain": 80002, + "commit": "9b17a1c" +} \ No newline at end of file diff --git a/script/DeployMockCurrency.s.sol b/script/DeployMockCurrency.s.sol new file mode 100644 index 0000000..10b3ce6 --- /dev/null +++ b/script/DeployMockCurrency.s.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + +import {ForkManagement} from 'script/helpers/ForkManagement.sol'; +import 'forge-std/Script.sol'; + +import {MockCurrency} from 'script/mocks/MockCurrency.sol'; + +contract DeployMockCurrency is Script, ForkManagement { + using stdJson for string; + + struct LensAccount { + uint256 ownerPk; + address owner; + uint256 profileId; + } + + LensAccount deployer; + LensAccount governance; + LensAccount proxyAdmin; + + string mnemonic; + + function loadPrivateKeys() internal { + if (isEnvSet('MNEMONIC')) { + mnemonic = vm.envString('MNEMONIC'); + } + + if (bytes(mnemonic).length == 0) { + revert('Missing mnemonic'); + } + + console.log('\n'); + + (deployer.owner, deployer.ownerPk) = deriveRememberKey(mnemonic, 0); + console.log('\n- - - DEPLOYER: %s', deployer.owner); + console.log('\n- - - DEPLOYER PK: %s', deployer.ownerPk); + (governance.owner, governance.ownerPk) = deriveRememberKey(mnemonic, 1); + console.log('\n- - - GOVERNANCE: %s', governance.owner); + console.log('\n- - - GOVERNANCE PK: %s', governance.ownerPk); + (proxyAdmin.owner, proxyAdmin.ownerPk) = deriveRememberKey(mnemonic, 2); + console.log('\n- - - PROXYADMIN: %s', proxyAdmin.owner); + console.log('\n- - - PROXYADMIN PK: %s', proxyAdmin.ownerPk); + + console.log('\n'); + + console.log('Current block:', block.number); + } + + function deploy() internal { + console.log('Deploying...'); + + string memory name = 'Bonsai'; + string memory symbol = 'BONSAI'; + + vm.startBroadcast(deployer.ownerPk); + address mockCurrency = address(new MockCurrency(name, symbol)); + vm.stopBroadcast(); + + console.log('Deployed MockCurrency(%s, %s) at: %s', name, symbol, mockCurrency); + } + + function run(string memory targetEnv_) external { + targetEnv = targetEnv_; + loadJson(); + checkNetworkParams(); + loadBaseAddresses(); + loadPrivateKeys(); + deploy(); + } +} diff --git a/script/mocks/MockCurrency.sol b/script/mocks/MockCurrency.sol new file mode 100644 index 0000000..452c678 --- /dev/null +++ b/script/mocks/MockCurrency.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.15; + +import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; + +/** + * @dev A simple mock currency to be used for testnet mocks. + */ +contract MockCurrency is ERC20 { + constructor(string memory name, string memory symbol) ERC20(name, symbol) {} + + function mint(address to, uint256 amount) external { + _mint(to, amount); + } +}