mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Erc20::approve for DestinationType::Contract
This allows the CREATE code to bork without the Serai router losing access to the coins in question. It does incur overhead on the deployed contract, which now no longer just has to query its balance but also has to call the transferFrom, but its a safer pattern and not a UX detriment. This also improves documentation.
This commit is contained in:
@@ -33,16 +33,14 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
// These are detected multiple times and distinguished, hence their renaming to canonical forms
|
||||
fs::rename(
|
||||
artifacts_path.clone() + "/Router_sol_Router.bin",
|
||||
artifacts_path.clone() + "/Router.bin",
|
||||
)
|
||||
.unwrap();
|
||||
fs::rename(
|
||||
artifacts_path.clone() + "/Router_sol_Router.bin-runtime",
|
||||
artifacts_path.clone() + "/Router.bin-runtime",
|
||||
)
|
||||
.unwrap();
|
||||
let router_bin = artifacts_path.clone() + "/Router.bin";
|
||||
let _ = fs::remove_file(&router_bin); // Remove the file if it already exists, if we can
|
||||
fs::rename(artifacts_path.clone() + "/Router_sol_Router.bin", &router_bin).unwrap();
|
||||
|
||||
let router_bin_runtime = artifacts_path.clone() + "/Router.bin-runtime";
|
||||
let _ = fs::remove_file(&router_bin_runtime);
|
||||
fs::rename(artifacts_path.clone() + "/Router_sol_Router.bin-runtime", router_bin_runtime)
|
||||
.unwrap();
|
||||
|
||||
// This cannot be handled with the sol! macro. The Router requires an import
|
||||
// https://github.com/alloy-rs/core/issues/602
|
||||
|
||||
Reference in New Issue
Block a user